diff --git a/tests/test_agents.py b/tests/test_agents.py index 89ee3fcf3..77421c2c7 100644 --- a/tests/test_agents.py +++ b/tests/test_agents.py @@ -1,4 +1,5 @@ from agents import Direction +from agents import ReflexVacuumAgent, ModelBasedVacuumAgent, TrivialVacuumEnvironment def test_move_forward(): d = Direction("up") @@ -38,3 +39,26 @@ def test_add(): assert l1.direction == Direction.U assert l2.direction == Direction.D #fixed +def test_ReflexVacuumAgent() : + # create an object of the ReflexVacuumAgent + agent = ReflexVacuumAgent() + # create an object of TrivialVacuumEnvironment + environment = TrivialVacuumEnvironment() + # add agent to the environment + environment.add_thing(agent) + # run the environment + environment.run() + # check final status of the environment + assert environment.status == {(1,0):'Clean' , (0,0) : 'Clean'} + +def test_ModelBasedVacuumAgent() : + # create an object of the ModelBasedVacuumAgent + agent = ModelBasedVacuumAgent() + # create an object of TrivialVacuumEnvironment + environment = TrivialVacuumEnvironment() + # add agent to the environment + environment.add_thing(agent) + # run the environment + environment.run() + # check final status of the environment + assert environment.status == {(1,0):'Clean' , (0,0) : 'Clean'}
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: