Download Intelligent Agents in Driving Simulator

Transcript
bit unnatural. It had a habit of starting and overtaking at very dumb moments and having
to abort overtaking to avoid a collision.
Example of what is required for the built in overtaking system:
Part[].RuleOvertaking = True;
Our own agent on the other hand managed to perform much better for the actual
beginning and ending of an overtake, but I could not get past a limit by the default rules
that made our overtaking car act like a coward and stop mid-overtaking and try and return
to the previous lane. Because of this behavior being a very basic, default behavior it
would have been difficult to change it. The solution, which had its own limits, was to
remove the agent’s forward checking during an overtaking. This lead to not being able to
adapt to changed circumstances, since the agents were blind when it came to meeting cars
during overtaking so they might drive straight through them. This would happen if the
meeting cars did not act as the overtaking agent expected them to act when it calculated if
it was safe to pass.
Here are a few of the key functions in the code:
Do {
//Check for cars getting close that we can overtake
LeadVehicle := Part[].FirstLeadOnMyLane;
LeadIsClose := False;
If ( LeadVehicle >= 0 ) {
If ( Part[].DisToFirstLeadOnMyLane < 30 and Aggressivity > 0.0 ) {
LeadIsClose := True;
}
SecondCarDistance := Part[LeadVehicle].DisToLeadCar;
}
This code checks for vehicles ahead of the current agent. If it would happen to be within
a distance of 30 meters and the agent is not told to be aggressive but very careful then this
code should inform the agent that it is getting close to a lead car. An extra check for the
distance to the car ahead of the lead car is added to make the agent handle passing more
than one car better.
Even with the extensive research in behavior and suggested formulas the knowledge
collected beforehand was not particularly useful when implementing overtaking in ST
Software. ST Software offered a lot of built-in functions for reading various data—other
data, outside of this, was not accessible. As a result, the final version of the overtaking
agent used a sort of state machine for overtaking. The overtaking state machine has 5
states. Begin overtaking, change lane left, pass, return to right lane, and finish. The basic
idea is that each of these are confined to a type called action which work just as member
functions inside a PartScen[] which is a custom scenario attached to a participant or in
other words agent. Each action has a starting case and a finishing case. So in general all
these states in the state machine are triggered by a state being a certain value and finishes
by setting the state to the consecutive value.
50