Simulator/src/model/map/ModelComponentBuilder.java
/**
	 * Creates a queue with a specified number of lanes and width. A blocking
	 * wall (a large wall to prevent agents from moving past the queue) can be
	 * added as well. The rotation degree indicates the angle the queue is
	 * rotated around the origin position.
	 * 
	 * @param start
	 *            The starting position.
	 * @param numberOfLanes
	 *            The number of lanes.
	 * @param queueWidth
	 *            The width of the queue.
	 * @param addBlockingWall
	 *            Flag to indicate if we want to add a blocking wall.
	 * @param rotationOrigin
	 *            The rotation origin.
	 * @param degreeRotation
	 *            The degrees it is rotated (in deg.).
	 * @return A list of SimulationObjects that form the queue.
	 */
Creates a queue with a specified number of lanes and width. A blocking
wall (a large wall to prevent agents from moving past the queue) can be
added as well. The rotation degree indicates the angle the queue is
rotated around the origin position.

@param start
The starting position.
@param numberOfLanes
The number of lanes.
@param queueWidth
The width of the queue.
@param addBlockingWall
Flag to indicate if we want to add a blocking wall.
@param rotationOrigin
The rotation origin.
@param degreeRotation
The degrees it is rotated (in deg.).
@return A list of SimulationObjects that form the queue.
Creates a queue with a specified number of lanes and width . A blocking wall ( a large wall to prevent agents from moving past the queue ) can be added as well . The rotation degree indicates the angle the queue is rotated around the origin position . @param start The starting position . @param numberOfLanes The number of lanes . @param queueWidth The width of the queue . @param addBlockingWall Flag to indicate if we want to add a blocking wall . @param rotationOrigin The rotation origin . @param degreeRotation The degrees it is rotated ( in deg . ) . @return A list of SimulationObjects that form the queue .
public static List<SimulationObject> queue(Position start, int numberOfLanes, double queueWidth,
			boolean addBlockingWall, Position rotationOrigin, double degreeRotation) {
		double xOffsetQueue = start.x;
		double yOffsetQueue = start.y;
		double walkWidth = 1;
		double queueHeight = 0.1;
		List<SimulationObject> components = new ArrayList<>();
		for (int i = 0; i <= numberOfLanes; i++) {
			QueueSeparator queueSeparationUnit = null;
			if (i % 2 == 0)
				queueSeparationUnit = createQueueSeparator(
						new Position(xOffsetQueue + 1, yOffsetQueue + (i * walkWidth)), queueWidth - 1, queueHeight,
						rotationOrigin, degreeRotation);
			else
				queueSeparationUnit = createQueueSeparator(new Position(xOffsetQueue, yOffsetQueue + (i * walkWidth)),
						queueWidth - 1, queueHeight, rotationOrigin, degreeRotation);
			components.add(queueSeparationUnit);
		}
		QueueSeparator queueSeparationUnit = createQueueSeparator(new Position(xOffsetQueue - 0.1, yOffsetQueue), 0.1,
				numberOfLanes * walkWidth + queueHeight, rotationOrigin, degreeRotation);
		components.add(queueSeparationUnit);
		queueSeparationUnit = createQueueSeparator(new Position(xOffsetQueue + queueWidth, yOffsetQueue), 0.1,
				numberOfLanes * walkWidth + queueHeight, rotationOrigin, degreeRotation);
		components.add(queueSeparationUnit);
		if (addBlockingWall) {
			Wall blockingWall = createWall(new Position(0, yOffsetQueue), xOffsetQueue, queueHeight, rotationOrigin,
					degreeRotation);
			components.add(blockingWall);
			blockingWall = createWall(new Position(xOffsetQueue + queueWidth, yOffsetQueue), 35, queueHeight,
					rotationOrigin, degreeRotation);
			components.add(blockingWall);
		}
		List<Position> corners = new ArrayList<>();
		corners.add(Utilities.transform(start, rotationOrigin, degreeRotation));
		corners.add(Utilities.transform(new Position(start.x + queueWidth, start.y), rotationOrigin, degreeRotation));
		corners.add(Utilities.transform(
				new Position(start.x + queueWidth,
						start.y + numberOfLanes * (walkWidth + queueHeight / 2) - queueHeight),
				rotationOrigin, degreeRotation));
		corners.add(Utilities.transform(
				new Position(start.x, start.y + numberOfLanes * (walkWidth + queueHeight / 2) - queueHeight),
				rotationOrigin, degreeRotation));
		Position entrance = Utilities.transform(new Position(start.x + 0.5, start.y), rotationOrigin, degreeRotation);
		Position leaving = Position.NO_POSITION;
		if (numberOfLanes % 2 != 0) {
			leaving = Utilities.transform(
					new Position(start.x + queueWidth - 0.5,
							start.y + numberOfLanes * (walkWidth + queueHeight / 2) - queueHeight),
					rotationOrigin, degreeRotation);
		} else {
			leaving = Utilities.transform(
					new Position(start.x + 0.5, start.y + numberOfLanes * (walkWidth + queueHeight / 2) - queueHeight),
					rotationOrigin, degreeRotation);
		}
		components.add(new QueuingArea(corners, leaving, entrance));
		return components;
	}
public static List < SimulationObject > queue ( Position start , int numberOfLanes , double queueWidth , boolean addBlockingWall , Position rotationOrigin , double degreeRotation ) { double xOffsetQueue = start . x ; double yOffsetQueue = start . y ; double walkWidth = 1 ; double queueHeight = 0.1 ; List < SimulationObject > components = new ArrayList < > ( ) ; for ( int i = 0 ; i <= numberOfLanes ; i ++ ) { QueueSeparator queueSeparationUnit = null ; if ( i % 2 == 0 ) queueSeparationUnit = createQueueSeparator ( new Position ( xOffsetQueue + 1 , yOffsetQueue + ( i * walkWidth ) ) , queueWidth - 1 , queueHeight , rotationOrigin , degreeRotation ) ; else queueSeparationUnit = createQueueSeparator ( new Position ( xOffsetQueue , yOffsetQueue + ( i * walkWidth ) ) , queueWidth - 1 , queueHeight , rotationOrigin , degreeRotation ) ; components . add ( queueSeparationUnit ) ; } QueueSeparator queueSeparationUnit = createQueueSeparator ( new Position ( xOffsetQueue - 0.1 , yOffsetQueue ) , 0.1 , numberOfLanes * walkWidth + queueHeight , rotationOrigin , degreeRotation ) ; components . add ( queueSeparationUnit ) ; queueSeparationUnit = createQueueSeparator ( new Position ( xOffsetQueue + queueWidth , yOffsetQueue ) , 0.1 , numberOfLanes * walkWidth + queueHeight , rotationOrigin , degreeRotation ) ; components . add ( queueSeparationUnit ) ; if ( addBlockingWall ) { Wall blockingWall = createWall ( new Position ( 0 , yOffsetQueue ) , xOffsetQueue , queueHeight , rotationOrigin , degreeRotation ) ; components . add ( blockingWall ) ; blockingWall = createWall ( new Position ( xOffsetQueue + queueWidth , yOffsetQueue ) , 35 , queueHeight , rotationOrigin , degreeRotation ) ; components . add ( blockingWall ) ; } List < Position > corners = new ArrayList < > ( ) ; corners . add ( Utilities . transform ( start , rotationOrigin , degreeRotation ) ) ; corners . add ( Utilities . transform ( new Position ( start . x + queueWidth , start . y ) , rotationOrigin , degreeRotation ) ) ; corners . add ( Utilities . transform ( new Position ( start . x + queueWidth , start . y + numberOfLanes * ( walkWidth + queueHeight / 2 ) - queueHeight ) , rotationOrigin , degreeRotation ) ) ; corners . add ( Utilities . transform ( new Position ( start . x , start . y + numberOfLanes * ( walkWidth + queueHeight / 2 ) - queueHeight ) , rotationOrigin , degreeRotation ) ) ; Position entrance = Utilities . transform ( new Position ( start . x + 0.5 , start . y ) , rotationOrigin , degreeRotation ) ; Position leaving = Position . NO_POSITION ; if ( numberOfLanes % 2 != 0 ) { leaving = Utilities . transform ( new Position ( start . x + queueWidth - 0.5 , start . y + numberOfLanes * ( walkWidth + queueHeight / 2 ) - queueHeight ) , rotationOrigin , degreeRotation ) ; } else { leaving = Utilities . transform ( new Position ( start . x + 0.5 , start . y + numberOfLanes * ( walkWidth + queueHeight / 2 ) - queueHeight ) , rotationOrigin , degreeRotation ) ; } components . add ( new QueuingArea ( corners , leaving , entrance ) ) ; return components ; }
Creates a queue with a specified number of lanes and width.
Creates a queue with a specified number of lanes and width .
// Queue // left queue separation unit // right queue separation unit // huge wall // auto create queuing areas