Interface IEnvironment

All Known Implementing Classes:
gsEnvironment, jmeEnvironment

public interface IEnvironment
Interface that any environment for Dedale's agent should implement
Author:
hc
  • Method Details

    • CreateEnvironment

      void CreateEnvironment(GeneratorType g, String topologyConfigurationFilePath, String instanceConfiguration, boolean diamond, boolean gold, boolean well, Integer... topologyParameters)
      Create an environment.
      Parameters:
      g - Type of environment (generated or manually designed)
      topologyConfigurationFilePath - FullPath to the file describing the topology
      instanceConfiguration - FullPath to the file describing the elements available on the map
      diamond - true if an automatically generated env should have diamond nodes on it
      gold - true if an automatically generated env should have gold nodes on it
      well - true if an automatically generated env should have wells on it
      topologyParameters - parameters used by the choosen generator. The number of parameters is generator dependent (size,...) All existing features are not available in randomly generated env : Treasure Locks,..
    • deployEntity

      void deployEntity(String entityName, EntityCharacteristics e, Location locationId)
      Add an entity to the graph
      Parameters:
      entityName - the name of the entity to deploy
      e - the EntityCharacteristics of the entity
      locationId - the (unique) Id of the position to deploy the agent, null if free
    • removeEntity

      void removeEntity(String entityName, EntityCharacteristics e)
    • getName

      String getName()
      Returns:
      The name of the environment
    • getCurrentPosition

      Location getCurrentPosition(String entityName)
      Parameters:
      entityName - Name of the agent to locate
      Returns:
      The entity current position, null if the entity is not in the environment
    • observe

      List<dataStructures.tuple.Couple<Location,List<dataStructures.tuple.Couple<Observation,String>>>> observe(Location currentPosition, String agentName)
      Parameters:
      currentPosition - the position from which the agent observe
      agentName - the name of the agent
      Returns:
      The list of observed positions, and for each one the list of observations
    • moveTo

      Integer moveTo(String entityName, EntityCharacteristics ec, Location targetedPosition)
      Parameters:
      entityName - the name of the entity
      ec - characteristics of the entity
      targetedPosition - its expected destination
      Returns:
      1 if true, 0 if refused, -1 if the consequence of the move is the agent dying
    • pick

      int pick(String entityName, Location location, ElementType e, Integer maxQuantity)
      Parameters:
      entityName - the name of the entity
      location - the position to pick the resource
      e - ElementType to pick
      maxQuantity - maximum number of e that the agent is able to pick
      Returns:
      the amount of resources that the agent was able to collect
    • openLock

      boolean openLock(String entityName, Location location, ElementType e)
      Parameters:
      entityName - the name of the entity
      location - the position to pick the resource
      e - Type of resource to unlock in the environment (Currently only gold or diamond )
      Returns:
      True is the lock is opened, false otherwise
    • closeLock

      boolean closeLock(Location location)
      Parameters:
      location - the position to close the safe(s)
      Returns:
      True if there was at least one safe on the current position (they are now closed), false otherwise
    • dropOff

      boolean dropOff(Location location, ElementType e, Integer quantity)
      This methods can only be called by specific types of agents. For the others it will do nothing.
      Parameters:
      location - id of the node where to drop the element
      e - the element the entity intends to drop
      quantity - the amount of value to drop on the current position
      Returns:
      true if the drop off was realised
    • throwGrenade

      boolean throwGrenade(String agentName, Location locationId)
      Parameters:
      agentName - The name of the agent that is shooting
      locationId - the id of the room it aims at
      Returns:
      true if done, false otherwise
    • isReachable

      boolean isReachable(String senderName, String receiverName, int communicationReach)
      Parameters:
      senderName - the senderAgent
      receiverName - The agent we are trying to contact
      communicationReach - the sender agent's com capability
      Returns:
      true if the receiver is within reach