crowdmodel.test
Class PerceiveTest

java.lang.Object
  extended by crowdmodel.CObject
      extended by crowdmodel.test.PerceiveTest

public class PerceiveTest
extends CObject

This class describes a test of the function of the implemented CrowdModel It concerns one of the major processes: perception By checking this process, the functioning of the structure components is also tested. It is not the most thorough way of code testing (as I am not testing every method) it is a pragmatic way of checking whether my theoretical model is working the way it is supposed to.

Author:
Nanda Wijermans

Field Summary
(package private)  CrowdAgent d_testDummy
           
(package private)  repast.simphony.context.Context d_world
           
 
Fields inherited from class crowdmodel.CObject
d_id, d_world_context
 
Constructor Summary
PerceiveTest(CrowdAgent agent)
           
 
Method Summary
 boolean checkBarPOIs()
          Checks whether the agents currently standing on at a bar (on a bar patch) have their physiology settings correctly updated
 boolean checkPrimingPersonFacts()
          Function that checks whether the perception of other agents (that are supposed to be seen) have their correct impact on the personFacts in terms of being primed.
 boolean checkStagePOI()
          Checks the effect of the stagePOI,
whether the vicinity of the stage has the proper effect on the id goal satisfaction level of the agent.
 boolean checkToiletPOIs()
          Checks whether the agents currently at a toilet (are situated on a toilet patch) have their physiology settings correctly updated (empty bladder)
 boolean emptyBladder(CrowdAgent ca)
          Function that checks whether the bladder of an agent is empty (equals 0)
 boolean fullStomach(CrowdAgent ca)
          Function that checks whether the stomach of an agent is full (equals 1)
 boolean perceivedBehaviours()
          Checks whether the perception of behaviours that are supposably seen by an agent are correctly handled by:
priming the corresponding behaviourRule in memory This is done for all agents.
 boolean perceivedPersons()
          Checks whether perceiving a person is correctly handled: 1) by priming the corresponding personFact in memory 2) density levels affecting physiology 3) satisfaction of the social goal
 boolean perceivedPOIs()
          Function checks whether the agents that are situated on POIs (point-of-interest's) have their internal settings correctly updated.
 boolean primingTest(java.lang.String elementName, CrowdAgent testDummy)
          Tests whether a memory element was primed during the current time step.
 void testIt()
          Tests all aspects of perception for every time step.
 
Methods inherited from class crowdmodel.CObject
CObject, delete, getID, step
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

d_world

repast.simphony.context.Context d_world

d_testDummy

CrowdAgent d_testDummy
Constructor Detail

PerceiveTest

public PerceiveTest(CrowdAgent agent)
Method Detail

testIt

public void testIt()
Tests all aspects of perception for every time step.


perceivedPOIs

public boolean perceivedPOIs()
Function checks whether the agents that are situated on POIs (point-of-interest's) have their internal settings correctly updated. This implies: - BAR-POIS : check for a full stomach - TOILET-POIS : check for an empty bladder - STAGE-POI: check for a random agent whether the id goal was correctly updated Note that this could be programmed more generic, however didn't do this because as I want to be able to specify the origin of the error in case something is not working well.


checkBarPOIs

public boolean checkBarPOIs()
Checks whether the agents currently standing on at a bar (on a bar patch) have their physiology settings correctly updated

Returns:
effect drinking beer takes place

checkToiletPOIs

public boolean checkToiletPOIs()
Checks whether the agents currently at a toilet (are situated on a toilet patch) have their physiology settings correctly updated (empty bladder)

Returns:
whether going to the toilet has (physiological) effect

checkStagePOI

public boolean checkStagePOI()
Checks the effect of the stagePOI,
whether the vicinity of the stage has the proper effect on the id goal satisfaction level of the agent.

based on the difference in registration the distance towards this poi can be Selects a random agent and based on its distance from the stage it checks whether the identity goal was correctly updated.

Returns:
proper effect of the Stage POI

perceivedBehaviours

public boolean perceivedBehaviours()
Checks whether the perception of behaviours that are supposably seen by an agent are correctly handled by:
This is done for all agents. So every agent is tested based upon it's current location and visible agents.


primingTest

public boolean primingTest(java.lang.String elementName,
                           CrowdAgent testDummy)
Tests whether a memory element was primed during the current time step.

Parameters:
elementName -
Returns:
whether element is primed t = now

perceivedPersons

public boolean perceivedPersons()
Checks whether perceiving a person is correctly handled: 1) by priming the corresponding personFact in memory 2) density levels affecting physiology 3) satisfaction of the social goal

Returns:
proper effect of stimuli on the agent

checkPrimingPersonFacts

public boolean checkPrimingPersonFacts()
Function that checks whether the perception of other agents (that are supposed to be seen) have their correct impact on the personFacts in terms of being primed.
When observing an other agents the corresponding facts need to be primed: - if known: the corresponding person fact (friends) - depending on membership: in or out group fact need to be primed

Returns:
correctness of priming given perception of other agents

fullStomach

public boolean fullStomach(CrowdAgent ca)
Function that checks whether the stomach of an agent is full (equals 1)

Parameters:
agent -
Returns:
whether the stomach is full

emptyBladder

public boolean emptyBladder(CrowdAgent ca)
Function that checks whether the bladder of an agent is empty (equals 0)

Parameters:
agent -
Returns:
whether bladder is empty