Class Environment
- java.lang.Object
- 
- jadex.bdi.examples.marsworld_classic.Environment
 
- 
 public class Environment extends java.lang.ObjectThe environment as singleton.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.ArrayListagentinfosThe hashtable containing all agent infos.static java.lang.StringCARRY_AGENTThe carry agent type.protected HomebasehomebaseThe agents homebase.protected static EnvironmentinstanceThe enviroment insstance.static java.lang.StringPRODUCTION_AGENTThe production agent type.static java.lang.StringSENTRY_AGENTThe sentry agent type.protected java.util.ArrayListtargetsThe target locations.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclearInstance()Clear the singleton instance.static EnvironmentcreateInstance(IClockService clock)Create a new instance.AgentInfo[]getAgentInfos()Get all agent infos.HomebasegetHomebase()Get the homebase.static EnvironmentgetInstance()Get the environment.TargetgetTarget(Location loc)Get a target for a location.TargetgetTarget(java.lang.String id)Get the target for the target-id.Target[]getTargets()The the info for an agent.Target[]getTargetsNear(Location loc, double tolerance)Get all targets near a position.voidsetAgentInfo(AgentInfo agentinfo)The the info for an agent.
 
- 
- 
- 
Field Detail- 
CARRY_AGENTpublic static final java.lang.String CARRY_AGENT The carry agent type.- See Also:
- Constant Field Values
 
 - 
PRODUCTION_AGENTpublic static final java.lang.String PRODUCTION_AGENT The production agent type.- See Also:
- Constant Field Values
 
 - 
SENTRY_AGENTpublic static final java.lang.String SENTRY_AGENT The sentry agent type.- See Also:
- Constant Field Values
 
 - 
agentinfosprotected java.util.ArrayList agentinfos The hashtable containing all agent infos.
 - 
targetsprotected java.util.ArrayList targets The target locations.
 - 
instanceprotected static Environment instance The enviroment insstance.
 - 
homebaseprotected Homebase homebase The agents homebase.
 
- 
 - 
Method Detail- 
getInstancepublic static Environment getInstance() Get the environment.- Returns:
- The environment.
 
 - 
createInstancepublic static Environment createInstance(IClockService clock) Create a new instance.
 - 
clearInstancepublic static void clearInstance() Clear the singleton instance.
 - 
getTargetspublic Target[] getTargets() The the info for an agent. / public void addTarget(Location target) { this.targets.put(target.getLocation(), target); } /** Get all targets.
 - 
getTargetsNearpublic Target[] getTargetsNear(Location loc, double tolerance) Get all targets near a position.
 - 
getHomebasepublic Homebase getHomebase() Get the homebase.
 - 
setAgentInfopublic void setAgentInfo(AgentInfo agentinfo) The the info for an agent.
 - 
getAgentInfospublic AgentInfo[] getAgentInfos() Get all agent infos.
 - 
getTargetpublic Target getTarget(Location loc) Get a target for a location. WARNING: Method does not check if more than one target is near.
 - 
getTargetpublic Target getTarget(java.lang.String id) Get the target for the target-id.
 
- 
 
-