Class Environment


  • public class Environment
    extends java.lang.Object
    The environment as singleton.
    • Field Detail

      • CARRY_AGENT

        public static final java.lang.String CARRY_AGENT
        The carry agent type.
        See Also:
        Constant Field Values
      • PRODUCTION_AGENT

        public static final java.lang.String PRODUCTION_AGENT
        The production agent type.
        See Also:
        Constant Field Values
      • SENTRY_AGENT

        public static final java.lang.String SENTRY_AGENT
        The sentry agent type.
        See Also:
        Constant Field Values
      • agentinfos

        protected java.util.ArrayList agentinfos
        The hashtable containing all agent infos.
      • targets

        protected java.util.ArrayList targets
        The target locations.
      • instance

        protected static Environment instance
        The enviroment insstance.
      • homebase

        protected Homebase homebase
        The agents homebase.
    • Method Detail

      • getInstance

        public static Environment getInstance()
        Get the environment.
        Returns:
        The environment.
      • clearInstance

        public static void clearInstance()
        Clear the singleton instance.
      • getTargets

        public Target[] getTargets()
        The the info for an agent. / public void addTarget(Location target) { this.targets.put(target.getLocation(), target); } /** Get all targets.
      • getTargetsNear

        public Target[] getTargetsNear​(Location loc,
                                       double tolerance)
        Get all targets near a position.
      • getHomebase

        public Homebase getHomebase()
        Get the homebase.
      • setAgentInfo

        public void setAgentInfo​(AgentInfo agentinfo)
        The the info for an agent.
      • getAgentInfos

        public AgentInfo[] getAgentInfos()
        Get all agent infos.
      • getTarget

        public Target getTarget​(Location loc)
        Get a target for a location. WARNING: Method does not check if more than one target is near.
      • getTarget

        public Target getTarget​(java.lang.String id)
        Get the target for the target-id.