How to use

The filter script uses the following commands from the command line: gawk, cut, sed, cat, and tac. Make sure they are correctly installed before running the filter.

Bellow is the format in which the filtering tool is used.

./filterFCD.sh OPTIONS... [FILE]

The tool filters the FCD output trace from SUMO simulation [FILE] and save the filtered version in ./filtered/ with the prefix "filtered_" appended. The default filtering configuration uses a radial distance of 500 meters around the vehicles of interest and uses neither tracking nor infection of interest. When no vehicles of interest are provided, only area and time-based filtering are performed if the appropriate arguments are provided.

  • -v [FILE/STRING]

    Input a csv file with your vehicles of interest; or a string with the names of your vehicles of interest separated by space.

  • -k [FILE/STRING]

    Input a csv file with your vehicles to be tracked; or a string with the names of your vehicles of interest separated by space. tracked vehicles will be in the final trace even if they are outside the area of interest.

  • -h

    Displays the help page of the program.

  • -c

    Define the neighborhood of the vehicles of interest as an geographic area with the shape of a square around each one of them (faster filtering).

  • -r

    Define the neighborhood using a radial distance from the vehicles of interest.

  • -d [distance]

    Define the filtering distance used by the squared (as half the size of the square's side) and radial filtering (distance from vehicle of interest) to determine neighborhood. The default value is 500 units.

  • -j [max_jumps]

    Define the maximum number of jumps a infection of interest can have. Default value is 1.

  • -b "x1 y1 x2 y2"

    Delimits a geographical area of interest using the point (x1, y1) as the lower left delimiter and the point (x2, y2) as the upper right delimiter of a rectangle. If "x1 y1 x2 y2" is not supplied, the smallest rectangle that covers the paths of all vehicles of interest with their respective neighboring areas is used.

  • -t "BEGIN END"

    Filters only the timesteps from the trace between the timesteps BEGIN and END. Other timesteps are cut off from the output. If no BEGIN and END time is given, only times

  • -i

    Vehicles that go into the neighboring vicinity of vehicles of interest or into the filtering area of the trace when there are no vehicles of interest become tracked. Tracked vehicles a throughout the whole trace. If -1 is given as argument, tracked vehicles entries outside of the filtering rectangle are ignored.

  • -s

    Vehicles that go into the neighboring vicinity of vehicles of interest become vehicles of interest themselves. This infection is limited by max_jumps.

  • -a

    Vehicles that go into the neighboring vicinity of vehicles of interest get tracked backwards in time and infect others backwards in time.

  • -z

    Shift timesteps so that the first timestep corresponds to the moment 0 of the simulation.

The filtering scheme uses three abstractions: vehicle of interest, tracked vehicles and area of interest. Each one can be configured by parameters given in command line.

Notations

Vehicle of interest: Vehicles that are at the focus of the simulation and whose interactions with others is relevant to the simulation. Usually they are the the source or the receiver of interactions throughout the trace. For this reason, every entry of its position and of it's neighbors are kept in the final trace.

Tracked vehicle: Vehicles whose trajectories should be kept in the final trace. All entries in the trace from tracked vehicles are kept in the output.

Area of interest: Geographic area of the trace in which vehicles of interest travel. Entries of the trace outside this area are cut off from the output.

Filtering Modes

The tool makes use of four main filtering options that can be used in conjunction to reduce the trace. Each option requires that at least one vehicle of interest be provided to the filtering tool.

Filtering using vehicles of interest: Once the vehicles of interest are supplied, the final trace will include all positional entries from the vehicles of interest and it's neighbors.

Filtering with tracking of contacts: Vehicles that go into the neighboring vicinity from any vehicle of interest become tracked vehicles and have their following entries saved in the final trace. This option is given avoid inconsistencies in the simulation from nodes exiting and returning to the filtering area (having discontinuous entries).

Filtering with interest contamination: Vehicles that go into the neighboring vicinity from any vehicle of interest may become vehicles of interest themselves as long as the number of jumps the contamination took from the original vehicle of interest doesn't exceed a set limit. The contaminated vehicles behave exactly as a vehicle of interest (having their entries and their neighbor's entries saved to the trace).

Filtering with backward interest contamination: Analogous to the filtering with interest contamination, the filtering with backward interest contamination reads the trace file in the inverse order and makes so that vehicles that go into the neighboring vicinity from any vehicle of interest have theirs entries tracked backwards in time and saved in the final trace. Their neighbors can also become tracked vehicles as long as the number of jumps the contamination took from the original vehicle of interest doesn't exceed a set limit.

Graphical Representation

Below is a graphical representation of how the filtering is performed: using vehicle of interest with vehicle tracking set by -i in Figure 1; and using infection of interest in Figure 2.

αvivrbecomesatrackedvehicleaftergoingintotheneighboringareaofvivivivivrvrvrX1X2Y1Y2(a)t=t0.αvivivivivrvrvrX1X2Y1Y2(b)t=t1.Figure1:(a)Thevehiclevrvrvrbecomesatrackedvehicle.(b)Afterdisconnectingfromvivivi,vrvrvrreturnstoit’sproximityatalatertime.αviviinfectsvsvivivivsvsvsv0sv0sv0sX1X2Y1Y2(a)t=t0.αvivsinfectsv0svivivivsvsvsv0sv0sv0sX1X2Y1Y2(b)t=t1.Figure2:(a)Thevehiclevsvsvsisinfectedbyvivivi.(b)vsvsvsandv0sv0sv0salsobehavelikevi,beingv0sv0sv0sinfectedbyvsvsvswhenbothmetbetweentheinstantst0t0t0andt1t1t1.

Variables Used

These are the variables that are used inside the code to carry out the filtering.

  • vehicles

    Array with the vehicles of interest given by the option -v.

  • tracked_v

    Array with the tracked vehicles given by the option -k, or acquired through the option -i.

  • distance

    Distance used to determine the neighboring area around the vehicles of interest.

  • Box

    Is an array of four elements that store the values of "x1 y1 x2 y2" respectively. The pair (x1, y1) define the lower left corner of the area of interest characterized as a rectangle and the pair (x2, y2) define it's upper right corner.

  • BEGIN

    Defines the start time for the time window in which the filtering takes place. Entries in the trace from timesteps before BEGIN are ignored. It is set by the option -t.

  • END

    Defines the end time for the time window in which the filtering takes place. Entries in the trace from timesteps after END are ignored. It is set by the option -t.

  • Delta_time

    Flag set by option -z that determines if the filtered timesteps should be shifted so that the first timestep corresponds the moment 0 of the simulation.

  • tracking_F

    Flag set by option -i that indicates that vehicles that go into the neighboring vicinity of vehicles of interest, or into the filtering area of the trace when there are no vehicles of interest, will become tracked vehicles.

  • Interest_Infect

    Flag set by option -s that indicates that vehicles that go into the neighboring vicinity of vehicles of interest become vehicles of interest themselves. This infection is limited by max_jumps.

  • Time_tracking

    Flag set by option -a that indicates that vehicles that go into the neighboring vicinity of vehicles of interest get tracked backwards in time and infect others backwards in time.

  • max_jumps

    Flag set by option -j it stores the maximum number of jumps that the infection of interest can make from the original vehicle of interest be it forwards or backwards in time.

1st Technical Report:

A first techinical report has been submitted to the Brazilian Symposium on Computer Networks and Distributed Systems (SBRC). More information on the filter workings can be found in it.