-
Notifications
You must be signed in to change notification settings - Fork 0
Dokumentation Implementierung
Im Rahmen des Projektes Verkehrssimulation beschreibt diese Dokumentation diverse Funktionen, Parameter und Schnittstellen der bereits gezeigten Klassen in der Dokumentation Softwaredesign. An dieser Stelle sei erwähnt, dass die folgenden Beschreibungen auf Englisch sind, da für die Source-Code Kommentare ebenfalls diese Sprache bevorzugt wurde.
Description:
- Creates the traffic agent task from Task Factory
Parameters:
- none
Return value:
- Standard-System.Threading.Tasks.TaskFactory for the current task
Description:
- Starts the traffic agent task
Parameters:
- none
Return value:
- void
Description:
- Stops the traffic agent task
Parameters:
- none
Return value:
- void
Description:
Query the initial data of the simulation interface (map, config(TODO).Starts a Stopwatch for the clock, so that there
is the given amount of ticks within a second.Also calls the update method of all traffic light objects and send the
updated objects to the simulation.
Parameters:
- cancelToken: Token which tells the working loop that the program should stop
Return value:
- void
2.1.5 private TrafficLight.LightStatus convertLightStatus(ServiceReference1.TrafficLightStatus status)
Description:
Converts the status of the traffic lights from the interface type into the internal type
Parameters:
- status: light status to be converted (from interface type to internal type)
Return value:
- TrafficLight.LightStatus
2.1.6 private ServiceReference1.TrafficLightStatus convertLightStatus(TrafficLight.LightStatus status)
Description:
Convert the status of the traffic lights from the internal type into the interface type
Parameters:
- status: light status to be converted (from internal type to interface type)
Return value:
- TrafficLight.LightStatus
2.1.7 private TrafficLightGroup.Position convertLightPosition(ServiceReference1.TrafficLightPosition oldPosition)
Description:
Convert the position of the traffic lights from the interface type into the internal type
Parameters:
- oldPosition: light position to be converted (from interface type to internal type)
Return value:
- TrafficLightGroup.Position
Description:
Convert the internal traffic lights into traffic lights of the interface type and PUSH the traffic lights via the
interface to the simulation.
Parameters:
- none
Return value:
- void
Description:
Pulls the traffic lights from the simulation interface and convert them into internal traffic lights
Parameters:
- none
Return value:
- void
Description:
Changes the state from the actual state to the next state
Parameters:
- none
Return value:
- void
Description:
Check if current tick count is big enough to change the state and change the state if necessary. Also updates the
stateChanged reference
Parameters:
- stateChanged: Reference to the value which tells if a traffic light has changed his state
Return value:
- void
Description:
Sets the Offset of a traffic light group, depending on the amount of traffic lights in the group
Parameters:
- none
Return value:
- void
Description:
Sets the Duration of all traffic lights in the group
Parameters:
- none
Return value:
- void
Description:
Calls the update method of all traffic lights in the group
Parameters:
- stateChanged: Reference to the value which tells if at least one traffic light has changed his state
Return value:
- void
Description:
Get the distance squared between two points
Parameters:
- x: first x point
- y: first y point
- x1: second x point
- y1: second y point
Return value:
- double: distance
Description:
Get the distance between two points
Parameters:
- x: first x point
- y: first y point
- x1: second x point
- y1: second y point
Return value:
- double: distance
Description: Class for loading the vehicle - configuration into an setting object defined in App.config
Description: Class for loading the general configuration into an setting object defined in App.config
Description:
Class for loading the traffic control configuration into an setting object defined in App.config
Description:
Helperclass for using a stopwatch with a defined offset
Description:
Method for starting the stopwatch
Parameters:
- none
Return value:
- void
Description:
Method for stopping the stopwatch
Parameters:
- none
Return value:
- void
Description:
Field which contains the elapsed timespan.
Parameters:
- none
Return value:
- Timespan: getter
Description:
Basic Element for the simulation and the GUI
Description:
Enum for the two needed blocktypes: staticBlocks can't move or change their behavior, dynamic blocks do that
Parameters:
- StaticBlock: block that cannot move
- DynamicBlock: block that can move
Return value:
- int
Description:
Basic Class for most of the dynamic blocks, it adds the TmxObject to the dynamic block. This enables the transmission
and usage for the GUI.
Description:
Basic Class for most of the dynamic blocks, it defines the minimal Fields which every dynamic block needs
Description:
Basic Class for all roadsigns.
Description:
Implementation of the RoadSign class for the traffic light objects of the simulation and GUI.
Description:
Enum for the different light states. enum numbers equals the GID of the GUI-block
Parameters:
- Red: 12
- Yellow: 13
- Green: 14
- YellowRed: 15
- Off: 16
Return value:
- int
Description:
MEthod to change the traffic lights state while the traffic control is not available and simulation is in emergency
traffic-control-mode.
Parameters:
- none
Return value:
- void
Description:
Like Crossing Element and adds Coordinates and set Type to staticBlock
Description:
Enum for the directions in which a street block leads
Parameters:
- RightToLeft: 3
- LeftToRight: 4
- TopToBottom: 5
- BottomToTop: 6
- Crossing: 7
Return value:
- int
Description:
Enum for the possible Directions in which a crossing element leads
Parameters:
- Left: left diretion
- Right: right diretion
- Straight: straight diretion
- None: no diretion
Return value:
- int
Description:
Enum for the possible vehicle types, values equals the GID of the values
Parameters:
- Car1: 1004
- Car2: 1001
- Truck1: 1000
- Truck2: 1002
- Motorcycle: 1003
Return value:
- int
Description:
helper class for the simulation logic to handle X and Y coordinates and rotation in one class
Description:
Init Method for the Simulator, in here, there are the initial instantiations of some fields and first creation
of the map
Description:
Event handler for the external vehicle receiving.
Parameters:
- sender: Object Sender
- e: VehicleEventArgs
Return value:
- void
Description:
Method to initialize the list of spawning points by checking the streetblocks which leads into the map and are on the
border of the map.
Parameters:
- none
Return value:
- void
Description:
Method to initialize the list of spawning points by checking the streetblocks which leads into the map and are on the
border of the map.
Parameters:
- none
Return value:
- void
Description:
Method contains the main loop of the simulation in which the simulation logic includig the call of the block updates
run.
Parameters:
- none
Return value:
- void
Description:
Method to choose a vehicle out of the vehicles to spawn and remove the spawned vehicle from the spawning list.
Parameters:
- spawningList: List of integer which contains the GID of the vehicles to spawn
Return value:
- void
Description:
Method to initialize the list of spawning points by checking the streetblocks which leads into the map and are on the
border of the map.
Parameters:
- tempGID: GID of the vehicle to spawn
Return value:
- void
3.10.9 public List<List> getMapInfo(double vehicleX, double vehicleY, double rotation, Dictionary<VehicleMovementAgent.side, int> directionDistances, ref int actPosInMapListX, ref int actPosInMapListY, ref int actoffsetX, ref int actoffsetY)
Description:
Method to create the map in the sight of the vehicle in the vehicle-given view-range
Parameters:
- vehicleX: actual X coordinates of the vehicle
- vehicleY: actual Y coordinates of the vehicle
- directionDistances: actual rotation of the vehicle
- actPosInMapListX: GID of the vehicle to spawn
- actPosInMapListY: GID of the vehicle to spawn
- actoffsetX: GID of the vehicle to spawn
- actoffsetY: GID of the vehicle to spawn
Return value:
- List: List
Description:
Method to add a street or crossing block of the given GID (param 1) to the given position (param 2 and 3)
Parameters:
- GID: GID of the block to set
- posX: x position to set the block
- posY: y position to set the bloc
Return value:
- StreetBlock
3.10.11 public List<List> getDynamicInfo(double vehicleX, double vehicleY, double rotation, Dictionary<VehicleMovementAgent.side, int> directionDistances)
Description:
Method to get the dynamic blocks
Parameters:
- vehicleX: actual X coordinates of the vehicle
- vehicleY: actual Y coordinates of the vehicle
- rotation: Gactual rotation of the vehicle
- directionDistances: Dictionary which contains the distances for the viewing range
Return value:
- StreetBlock
Description:
Get the distance squared between two points
Parameters:
- point1: point one
- point2: point two
Return value:
- double: distance
Description:
Get the distance between two points
Parameters:
- point1: point one
- point2: point two
Return value:
- double: distance
Description:
Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any
required services and load any non-graphic related content. Calling base.Initialize will enumerate through any
components and initialize them as well.
Parameters:
- none
Return value:
- void
Description:
LoadContent will be called once per game and is the place to load all of your content.
Parameters:
- none
Return value:
- void
Description:
UnloadContent will be called once per game and is the place to unload game-specific content.
Parameters:
- none
Return value:
- void
Description:
Allows the game to run logic such as updating the world, checking for collisions, gathering input, and playing audio.
Parameters:
- gameTime: Provides a snapshot of timing values
Return value:
- void
Description:
This is called when the game should draw itself.
Parameters:
- gameTime: Provides a snapshot of timing values
Return value:
- void