Aimsun Next API Pedestrians¶
Functions related to Pedestrians¶
Introduce Pedestrians into the model¶
In C++ and Python¶
Explanation¶
Introduce Pedestrians into the model setting their origin, destination, route and the number of pedestrians. Using this method, pedestrians will enter the model as soon as they can.
Format¶
int AKIGeneratePedestrians(int fromCentroid, int toCentroid, int idRoute, double nbPedestrians);
Parameters¶
- fromCentroid The Pedestrian Entrance Centroid id.
- toCentroid: The Pedestrian Exit Centroid id.
- idRoute The route id that pedestrians will follow. If set to -1, pedestrians will follow the shortest path to their destination.
- nbPedestrians: The number of pedestrians to generate.
Output:
- ≥ 0: Pedestrians have entered successfully in the model.
- < 0: Error
Introduce Pedestrians into the model during a time interval¶
In C++ and Python¶
Explanation¶
Introduce Pedestrians into the model setting their origin, destination, route, the number of pedestrians and the interval time. Using this method, pedestrians will enter the model using a uniform distribution during the time interval.
Format¶
int AKIGeneratePedestriansInTime(int fromCentroid, int toCentroid, int idRoute, double nbPedestrians, double timeInterval);
Parameters¶
- fromCentroid:The Pedestrian Entrance Centroid id.
- toCentroid: The Pedestrian Exit Centroid id.
- idRoute: The route id that pedestrians will follow. If set to -1, pedestrians will follow the shortest path to their destination.
- nbPedestrians: The number of pedestrians to generate.
- *timeInterval: The time interval in seconds when the pedestrians will be generated.
Output¶
- ≥ 0: Pedestrians have entered successfully in the model.
- < 0: Error
Read the Static information of a Pedestrian¶
In C++ and Python¶
Explanation¶
Read the static information of a pedestrian. Static information is the characteristics of the pedestrian which were set when the pedestrian entered in the system.
Format¶
StaticInfPed AKIPedestrianGetStaticInf( std::uint32_t aidPedestrian );
Parameters¶
- aidPedestrian: Pedestrian Identifier
Output¶
struct StaticInfPed {
std::int32_t report;
std::uint32_t id;
std::uint32_t originID;
std::uint32_t destinationID;
double radius;
double preferredWalkSpeed;
double preferredRunSpeed;
};
where:
- report: 0, OK, else error code
- id: pedestrian identifier
- originID: Identifier of pedestrian entrance origin of the pedestrian.
- destinationID: Identifier of pedestrian exit destination of the pedestrian.
- radius: pedestrian radius (m or feet, depending on the units defined in the network).
- preferredWalkSpeed: Preferred walk speed of the pedestrian (km/h or mph, depending on the units defined in the network).
- preferredRunSpeed: Preferred run speed of the pedestrian (m/s2 or ft/ s2, depending on the units defined in the network).
Modify the Static Information of a Pedestrian¶
In C++ and Python¶
Explanation¶
Modify some of the static parameters of a pedestrian. Static parameters are the characteristics of the pedestrain which were set when the vehicle entered in the system. The static parameters that it is possible to change are: pedestrian exit, radius, preferred walk speed and preferred run speed.
Format¶
void AKIPedestrianSetStaticInf( StaticInfPed newstaticInfPed );
Parameters¶
- newstaticInfPed: new static parameters to be assigned to the pedestrian with identifier the one in the struct.
Output¶
- None
Read the information of a Pedestrian¶
In C++ and Python¶
Explanation¶
Read the information of a pedestrian.
Format¶
InfPed AKIPedestrianGetInf( std::uint32_t aidPedestrian );
Parameters¶
- aidPedestrian: Pedestrian Identifier
Output¶
struct InfPed {
std::int32_t report;
std::uint32_t id;
InfPosition position;
double speed;
};
where:
- report: 0, OK, otherwise value represents an error code
- id: the pedestrian identifier.
- position: the pedestrian current location using the following struct: struct InfPosition { double x; double y; double z; };
- speed: the pedestrian's current speed (in km/h or mph, depending on the units defined in the network).