Takes the car agent and tries to put it as a car into the specified location inside a road network. The car can appear on the specified road or in the specified parking lot (defined by the Appears parameter).
If cars are set to appear on a road, the direction of the road should be additionally specified. Cars will appear at the beginning of the specified road and start moving in the specified direction. By default, Random lane parameter is selected, so the cars will appear at random lanes (if there is more than 1 lane on the specified road). You can explicitly specify index of lane where cars will appear by deselecting the Random lane option and using Lane index parameter.
If cars are set to appear on a road, they enter the road network only when there is enough distance on the lane ahead of the car. The more initial velocity of the car, the longer distance is needed for a car to safely enter the network. Cars that cannot enter the road network immediately are accumulated in queue inside CarEnter block and taken from the queue when there is enough space in the specified lane to place a car.
If cars are set to appear in a parking lot, they appear in free spaces of the specified parking lot and wait until they leave the road network or start moving by entering CarMoveTo block. If all parking spaces are occupied, an error will be generated.
Together with CarExit, this block is used to model part of the car movement on a higher abstraction level, namely without detailed physical level road traffic modeling.
Demo model: CarEnter and CarExit
setPreferredSpeed(speed)
function.long count() - Returns the number of cars that have entered the road network via this CarEnter block.