-
Notifications
You must be signed in to change notification settings - Fork 11
Solution to implementing the agent based model
Currently the simulation employs the deterministic model, where all aircrafts are closely following what the scheduler tells them to do. We need to implement an agent-based model, in which aircrafts could decide what they should do next by themselves according to the scheduler's instruction. In other words, after being assigned the next target position by the scheduler, an aircraft/agent adjusts its movement based on the surroundings.
Since all agents could share an identical and intuitive car-following model in our project, we plan to employ the equation below from [1]:
an(t) = α * Vn(t)^β * (ΔVn(t-τn) / ΔVn(t-τn)^γ)
where an(t) is the acceleration of the subject agent n at time t, ΔVn(t-τn) is the speed difference between the subject agent and the preceding one at time (t-τn), τn is the reaction time, and α, β, γ are parameters. In addition, we set a maximum of velocity to limit the speed.
To implement the agent based model, there are several parts need to be changed in our solution.
itinerary.py:: Previously, the itinerary contains a list of nodes on the node-link model as targets, because the agents only stop at nodes. However, in the agent-based model, each aircraft decides its velocity, and it can hardly stand on a node exactly at the end of a tick. Instead, they may stop at anywhere on links. Thus, we decide to store the links as targets in an itinerary. Also, now its index field means the number of the link, and a distance and the start_node be add to position an aircraft on the link.
o------------x-------o-----------o
| | |
start_node dist agent
aircraft.py:: 1) We plan to create a Movement class whose attributes includes velocity and acceleration, as well as methods to update these values. The Aircraft class add a instance of Movement as its new attributes. 2) What's more, the aircraft has a method to find out its closest proceeding agent. A inverted dictionary containing {link: [aircraft1, aircraft2, ...]} would be stored in the airport class to optimize the computational complexity. To find the one it is following, the aircraft iterates the links in its own itinerary on each tick, and uses the links one by one as the key to lookup the dictionary. Also, a maximum distance would limit the time of looking up. For instance, if there is no other planes within 200 in the front, the agent can run at the maximum velocity. 3) To calculate the distance between two aircrafts, we assume that the links between nodes in the node-link model are straight lines. We plan to create a lookup table to store the length of each link (divided by all nodes in the map)(straight or not?). The non-computational nodes in map help to increase the accuracy of the estimation. If two agents are on the same link, we will compute the distance between them.
scheduler: The intersection is another important case in the car-following model, and we decide to make our scheduler smart enough to avoid potential crash at intersections. Currently the scheduler find out the conflicts based on nodes in the itineraries, but things has been changed with agent-based model. A tricky corner case is showed below. Any ideas?
Bob's Comments: This all sounds good. The first general comment is that if the simulator is deterministic, then the order in which aircraft move is determined by the scheduler. The only time the agent might change the order of aircraft movement is if there is uncertainty on the simulation side (i.e. in the world). The agent of course determines velocity and acceleration, but again if there is no uncertainty then there is a fixed speed for each movement. (Of course, for the scheduler to predict accurately how a deterministic world will change over time it must know what these fixed speeds for each movement are.)
Let's look at the intersection model. Again, if there is a deterministic world, then the scheduler can always predict how the world will change. The scheduler should be able to say "Aircraft 1 should wait 5 minutes until after aircraft 2 crosses the intersection before it enters the intersection" and this should be what happens. Now let's assume uncertainty in the world for this simple case. First, let's assume that an agent can't change the order of aircraft on the taxiway. Then every decision will be made by Aircraft 1 to respond to aircraft 2's movement. If aircraft 2 crosses the intersection earlier than expected, then aircraft 1 will wait for a shorter period of time before it moves. If aircraft 2 crosses the intersection later than expected, then aircraft 1 will wait for a longer period of time. Also, if aircraft 1 gets to the intersection earlier than expected, then it will need to wait longer for aircraft 2 to pass the intersection. Finally, if aircraft 1 gets to the intersection later than expected, then it might be able to wait less time because aircraft 2 might already be crossing.
Finally, a more sophisticated agent model might allow agents to change their ordering. For example, let's support aircraft 2 is very late arriving to the intersection. Then agent 1 might say: I can enter the intersection safely before agent 2 so I will do so. I think what happens in the real world is that the scheduler will notice the delay and will tell the pilot of aircraft 1 to go ahead. We should discuss this case further.