Simulator/test/model/agent/humanAgent/aatom/operationalLevel/observation/impl/BasicPassengerObservationModuleTest.java
/**
	 * Tests the observation of a human agent.
	 */
Tests the observation of a human agent.
Tests the observation of a human agent .
@Test
	public void testPassengerObservation() {
		QueuingArea checkpointQueue = new QueuingArea(10, 10, 4, 4, new Position(10, 10), new Position(14, 14));
		GateArea gate = new GateArea(1, 1, 5, 5);
		QueuingArea checkInQueue = new QueuingArea(4, 5, 3, 3, new Position(7, 8), new Position(4, 5));
		Desk d = new Desk(4, 4, 1, 0.1, new Position(4.5, 4.3));
		List<Desk> desks = new ArrayList<>();
		desks.add(d);
		Flight f = new Flight(FlightType.ARRIVING, 7200, gate, desks, checkInQueue, checkpointQueue);
		Passenger p = new Passenger.Builder<>().setPosition(new Position(10.25, 10)).setFlight(f)
				.setLuggage(new Luggage(LuggageType.CARRY_ON, 1, 1)).build();
		AatomHumanAgent agent = generateBaseAgent();
		Simulator s = new Simulator.Builder<>().setEndingConditions(new BaseEndingConditions(20)).setGui(false).build();
		s.add(agent);
		s.add(p);
		Thread t = new Thread(s);
		t.start();
		while(!s.isRunning()) {
		}
		s.setRunning(false);
		Collection<Passenger> a = observation.getObservation(Passenger.class);
		s.setRunning(true);
		Assert.assertEquals(a.size(), 1);
	}
@ Test public void testPassengerObservation ( ) { QueuingArea checkpointQueue = new QueuingArea ( 10 , 10 , 4 , 4 , new Position ( 10 , 10 ) , new Position ( 14 , 14 ) ) ; GateArea gate = new GateArea ( 1 , 1 , 5 , 5 ) ; QueuingArea checkInQueue = new QueuingArea ( 4 , 5 , 3 , 3 , new Position ( 7 , 8 ) , new Position ( 4 , 5 ) ) ; Desk d = new Desk ( 4 , 4 , 1 , 0.1 , new Position ( 4.5 , 4.3 ) ) ; List < Desk > desks = new ArrayList < > ( ) ; desks . add ( d ) ; Flight f = new Flight ( FlightType . ARRIVING , 7200 , gate , desks , checkInQueue , checkpointQueue ) ; Passenger p = new Passenger . Builder < > ( ) . setPosition ( new Position ( 10.25 , 10 ) ) . setFlight ( f ) . setLuggage ( new Luggage ( LuggageType . CARRY_ON , 1 , 1 ) ) . build ( ) ; AatomHumanAgent agent = generateBaseAgent ( ) ; Simulator s = new Simulator . Builder < > ( ) . setEndingConditions ( new BaseEndingConditions ( 20 ) ) . setGui ( false ) . build ( ) ; s . add ( agent ) ; s . add ( p ) ; Thread t = new Thread ( s ) ; t . start ( ) ; while ( ! s . isRunning ( ) ) { } s . setRunning ( false ) ; Collection < Passenger > a = observation . getObservation ( Passenger . class ) ; s . setRunning ( true ) ; Assert . assertEquals ( a . size ( ) , 1 ) ; }
Tests the observation of a human agent.
Tests the observation of a human agent .
// generate passenger to observe