Simulator/test/model/agent/humanAgent/aatom/AatomHumanAgentTest.java
/**
	 * Tests the sitting of the agent.
	 */
Tests the sitting of the agent.
Tests the sitting of the agent .
@Test
	public void testSitDown() {
		AatomHumanAgent agent = generateBaseAgent();
		Simulator s = new Simulator.Builder<>().setEndingConditions(new BaseEndingConditions(10)).setGui(false).build();
		s.add(agent);
		Chair chair = new Chair(new Position(10, 10), new Position(10.25, 10.75), 0.5);
		s.add(chair);
		Thread t = new Thread(s);
		t.start();
		while(!s.isRunning()) {
		}
		s.setRunning(false);
		Assert.assertEquals(agent.getPosition(), new Position(10.25, 10.75));
		Assert.assertFalse(agent.isSitting());
		Assert.assertTrue(agent.operationalModel.setSitDown(chair));
		s.step();
		Assert.assertTrue(agent.isSitting());
		Assert.assertEquals(agent.getPosition(), new Position(10.25, 10.25));
	}
@ Test public void testSitDown ( ) { AatomHumanAgent agent = generateBaseAgent ( ) ; Simulator s = new Simulator . Builder < > ( ) . setEndingConditions ( new BaseEndingConditions ( 10 ) ) . setGui ( false ) . build ( ) ; s . add ( agent ) ; Chair chair = new Chair ( new Position ( 10 , 10 ) , new Position ( 10.25 , 10.75 ) , 0.5 ) ; s . add ( chair ) ; Thread t = new Thread ( s ) ; t . start ( ) ; while ( ! s . isRunning ( ) ) { } s . setRunning ( false ) ; Assert . assertEquals ( agent . getPosition ( ) , new Position ( 10.25 , 10.75 ) ) ; Assert . assertFalse ( agent . isSitting ( ) ) ; Assert . assertTrue ( agent . operationalModel . setSitDown ( chair ) ) ; s . step ( ) ; Assert . assertTrue ( agent . isSitting ( ) ) ; Assert . assertEquals ( agent . getPosition ( ) , new Position ( 10.25 , 10.25 ) ) ; }
Tests the sitting of the agent.
Tests the sitting of the agent .