-
Notifications
You must be signed in to change notification settings - Fork 0
Individual.gaml
Loïc SADOU edited this page Sep 28, 2020
·
6 revisions
Individual.gaml is a species that represents a person. The main goal for the individuals is to complete their agenda. An agenda is an ordered list of activities. An activity is defined by a place and an hour. Inherits from Passenger.
-
Attributes.
- day_agenda (list<list>): the individual agenda for the day.
- current_activity (predicate): the actual activity.
- waiting_activity (predicate): the next activity.
- joining_activity (bool): equals true if the individual is driving to join the activity place, equals if not.
- work_place (point): the individual work place.
- home_place (point): the individual home place.
- school_place (point): the individual school place.
- shopping_place (point): the individual shopping place.
- leisure_place (point): the individual leisure place.
- times_to_join_activity (list<list>): all the trip times made to join activities.
- times_spent_in_activity (list<list>): all the times spent in activities.
- transport_trip (list<list>): the trip the individual has to follow to join the activity. The list is like string tp_mode, point start_pos, point target_pos.
- trip_pointer (int): points towards the actual step of transport_trip.
-
Reflex
-
Action
- void registerNextActivity (void): Registers the next activity with the EventManager according to day_agenda. This action register an event with the timer defined in day_agenda and the message is the activity name.
- void setSignal (float signal_time, string signal_type): This action allows the transports to react to signals send by the EventManager and other species. The recognized signals are:
- "working","eating","staying at home","leisure","studying","manage kid","shopping" are signals received from the EventManager. They correspond to activities registered by registerNextActivity.
- "arrived","passenger","transport full" are signals received from transports. "passenger" notify the individual that he's actually just a passenger and "transport full" notify the individual that a public transport could not collect him because it was full.
- void compute_transport_trip (point excution_time): Compute trip steps to follow for joining the target_ destination. compute_transport_trip use transport_choice to choose the transport to use for this trip. The computed steps are stored in transport_trip.
- void executeTripPlan (float target_): Follow each step from the current transport_trip.
- string transport_choice (void): return the transport to use for a trip.
- void useCar (void): create a car and give it trip parameters. This action modify super species Passenger attribute current_car. The individual will be notified by "arrived" when the trip is over.
- void useCar (void): create a bike and give it trip parameters. This action modify super species Passenger attribute current_bike. The individual will be notified by "arrived" when the trip is over.
- void useCar (void): create legs and give it trip parameters. This action modify super species Passenger attribute current_walk. The individual will be notified by "arrived" when the trip is over.
- bool hasCar (void): return true if the individual has a car, return false if not.
- bool hasBike (void): return true if the individual has a bike, return false if not.
-
Experiment