Aimsun Next API Vehicle Entrance¶
Functions related to Vehicle Entrance¶
Introduce a Vehicle in flows and turning proportions traffic definition¶
In C++ and Python¶
Explanation¶
Introduce a new vehicle at the entrance of the specified section only if there is enough space. This function should be used only when the traffic demand is defined by flows and turnings proportions. When the vehicle has entered, Aimsun Next then assigns the vehicle lane and vehicle initial speed using its internal algorithms. If there is not enough space, the vehicle is not generated.
Format¶
int AKIEnterVehTrafficFlow(int asection, int vehTypePos, int tracking );
Parameters¶
- asection: Section Identifier where the vehicle will enter.
- vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 is used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
- tracking: 0 when the vehicle is not to be tracked, 1 otherwise.
Output¶
- ≥ 0: Identifier of the vehicle entered
- < 0: Error
Introduce a Vehicle in OD matrix traffic definition¶
In C++ and Python¶
Explanation¶
Introduce a vehicle at the entrance of the specified section with the specified origin and destination centroids. This function should be used only when the traffic demand is OD matrix based. The vehicle enters the network when the function is called only if there is enough space and Aimsun Next then assigns the vehicle lane and vehicle initial speed using its internal algorithms. If there is not enough space, the vehicle is not generated.
Format¶
int AKIEnterVehTrafficOD(int asection, int vehTypePos, int idCentroidOrigin, int idCentroidDest, int tracking);
Parameters:¶
- asection: Section Identifier where the vehicle will enter.
- vehTypePos The position of the vehicle type in the list of vehicles types being used. In the range 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
- idCentroidOrigin: Identifier of origin centroid of the vehicle. - idCentroidDest: Identifier of destination centroid of the vehicle.
- tracking: 0 when the vehicle is not to be tracked, 1 otherwise.
Output¶
- ≥ 0: Identifier of the vehicle entered
- < 0: Error
Put a Vehicle in flows and turning proportions traffic definition¶
In C++ and Python¶
Explanation¶
Generate a new vehicle in the specified section, lane and position with the specified speed. This function should be used only when the traffic demand is defined by flows and turnings proportions.
Format¶
int AKIPutVehTrafficFlow (int asection, int idLane, int vehTypePos, double initPosition, double initSpeed, int nextSection, int tracking);
Parameters¶
- asection: Section Identifier where the vehicle will enter.
- idLane: Lane Identifier where the vehicle will enter.
- vehTypePos : The position of the vehicle type in the list of vehicles types being used. 0 is used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
- initPosition: Initial position of the vehicle (in meters or feet depending on network units)
- initSpeed: Initial speed of the vehicle (in Km/h or mph depending on network units)
- nextSection: The next section that the vehicle will take. The value –1 means the first feasible turn.
- tracking: 0 when the vehicle will not be tracked, 1 otherwise.
Output¶
- ≥ 0: Identifier of the vehicle entered
- < 0: Error
Put a Vehicle in OD matrix traffic definition¶
In C++ and Python¶
Explanation¶
Generate a new vehicle in the specified section, lane, and position with the specified speed. This function also sets also the origin and destination centroids of the new vehicle. This function should be used only when the traffic demand is OD matrix based.
Format¶
int AKIPutVehTrafficOD(int asection, int idLane, int vehTypePos, int idCentroidOr, int idCentroidDest, double initPosition, double initSpeed, int tracking, bool use2Dim, double initYPosition, double initYSpeed );
Parameters¶
- asection: Section Identifier where the vehicle will enter.
- idLane: Lane Identifier where the vehicle will enter.
- vehTypePos : The position of the vehicle type in the list of vehicles types being used. 0 is used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
- idCentroidOrigin: Identifier of origin centroid of the vehicle.
- idCentroidDest: Identifier of destination centroid of the vehicle.
- initPosition: Initial position of the vehicle (in meters or feet depending on network units)
- initSpeed: Initial speed of the vehicle (in Km/h or mph depending on network units)
- tracking: 0 when the vehicle will not be tracked, 1 otherwise.
- use2Dim: True if vehicle position has two dimensions and therefore initYPosition and initYSpeed need to be assigned
- initYPosition: Initial lateral position of the vehicle (in meters or feet depending on network units)
- initYSpeed: Initial lateral speed of the vehicle (in Km/h or mph depending on network units)
Output¶
- ≥0: Identifier of the vehicle entered
- < 0: Error
Introduce a vehicle in flows and turning proportions traffic definition using the default entrance models¶
In C++ and Python¶
Explanation¶
Introduce a new vehicle at the entrance of the specified section only if there is enough space. This function should be used only when the traffic demand is defined by flows and turning proportions. As the vehicle enters, Aimsun Next then assigns the vehicle lane and vehicle initial speed using its internal algorithms. If there is no space for the vehicle to be introduced,there is an option to add this vehicle to the virtual entrance queue.
Format¶
InfArrival AKIGenerateArrivalTrafficFlow(int asection, int vehTypePos, int useVirtualQueue
Parameters¶
- asection: Section Identifier where it will enter a vehicle
- vehTypePos: The position of the vehicle type in the list of vehicles types being used. 0 is used for all vehicle types and a value from 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
- useVirtualQueue: 1 if the vehicle has no space to enter then the vehicle is stored in the virtual entrance queue, 0 is not stored in the virtual queue.
Output¶
struct InfArrival {
int report;
int idVeh;
bool inVirtualQueue;
int entranceSection;
};
where:
- report: 0, OK, else error code
- idVeh: > 0 Vehicle identifier entered in the system
- entranceSection: Entrance section identifier where the vehicle enters or is stored in the virtual entrance queue.
- inVirtualQueue: True the vehicle has not entered the system but has been stored in the virtual entrance Queue, false otherwise
Introduce a Vehicle into the OD matrix traffic definition using the default entrance models¶
In C++ and Python¶
Explanation¶
Introduce a vehicle at the entrance of the specified section, set its origin and destination centroids. This function should be used only when the traffic demand is OD matrix based. The vehicle enters the network when the function is called only if there is enough space and Aimsun Next then assigns the vehicle lane and vehicle initial speed using the internal models. If there is no space for the vehicle to be introduced,there is an option to add this vehicle to the virtual entrance queue.
Format¶
InfArrival AKIGenerateArrivalTrafficOD(int vehTypePos, int idCentroidOrigin, int idCentroidDest, int useVirtualQueue);
Parameters¶
- vehTypePos The position of the vehicle type in the list of vehicles types being used in the range 1 to AKIVehGetNbVehTypes (), for a specific vehicle type.
- idCentroidOrigin: Identifier of origin centroid of the vehicle.
- idCentroidDest: Identifier of destination centroid of the vehicle.
- useVirtualQueue: 1 if the vehicle has no space to enter then the vehicle is stored in the virtual entrance queue, 0 is not stored in the virtual queue.
Output¶
struct InfArrival {
int report;
int idVeh;
bool inVirtualQueue;
int entranceSection;
};
where:
- report: 0, OK, else error code
- idVeh: > 0 Vehicle identifier entered in the system
- entranceSection: Entrance section identifier where the vehicle has been entered or stored in the virtual entrance queue.
- inVirtualQueue: True the vehicle has not entered the system but has been stored in the virtual entrance queue, false otherwise