Package eu.su.mas.dedale.env
Interface IEnvironment
- All Known Implementing Classes:
gsEnvironment
,jmeEnvironment
public interface IEnvironment
Interface that any environment for Dedale's agent should implement
- Author:
- hc
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
CreateEnvironment
(GeneratorType g, String topologyConfigurationFilePath, String instanceConfiguration, boolean diamond, boolean gold, boolean well, Integer... topologyParameters) Create an environment.void
deployEntity
(String entityName, EntityCharacteristics e, Location locationId) Add an entity to the graphboolean
dropOff
(Location location, ElementType e, Integer quantity) This methods can only be called by specific types of agents.getCurrentPosition
(String entityName) getName()
boolean
isReachable
(String senderName, String receiverName, int communicationReach) moveTo
(String entityName, EntityCharacteristics ec, Location targetedPosition) List
<dataStructures.tuple.Couple<Location, List<dataStructures.tuple.Couple<Observation, String>>>> boolean
openLock
(String entityName, Location location, ElementType e) int
pick
(String entityName, Location location, ElementType e, Integer maxQuantity) void
removeEntity
(String entityName, EntityCharacteristics e) boolean
throwGrenade
(String agentName, Location locationId)
-
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 topologyinstanceConfiguration
- FullPath to the file describing the elements available on the mapdiamond
- true if an automatically generated env should have diamond nodes on itgold
- true if an automatically generated env should have gold nodes on itwell
- true if an automatically generated env should have wells on ittopologyParameters
- 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
Add an entity to the graph- Parameters:
entityName
- the name of the entity to deploye
- theEntityCharacteristics
of the entitylocationId
- the (unique) Id of the position to deploy the agent, null if free
-
removeEntity
-
getName
String getName()- Returns:
- The name of the environment
-
getCurrentPosition
- 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, observeString>>>> (Location currentPosition, String agentName) - Parameters:
currentPosition
- the position from which the agent observeagentName
- the name of the agent- Returns:
- The list of observed positions, and for each one the list of observations
-
moveTo
- Parameters:
entityName
- the name of the entityec
- characteristics of the entitytargetedPosition
- its expected destination- Returns:
- 1 if true, 0 if refused, -1 if the consequence of the move is the agent dying
-
pick
- Parameters:
entityName
- the name of the entitylocation
- the position to pick the resourcee
- ElementType to pickmaxQuantity
- maximum number of e that the agent is able to pick- Returns:
- the amount of resources that the agent was able to collect
-
openLock
- Parameters:
entityName
- the name of the entitylocation
- the position to pick the resourcee
- Type of resource to unlock in the environment (Currently only gold or diamond )- Returns:
- True is the lock is opened, false otherwise
-
closeLock
- 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
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 elemente
- the element the entity intends to dropquantity
- the amount of value to drop on the current position- Returns:
- true if the drop off was realised
-
throwGrenade
- Parameters:
agentName
- The name of the agent that is shootinglocationId
- the id of the room it aims at- Returns:
- true if done, false otherwise
-
isReachable
- Parameters:
senderName
- the senderAgentreceiverName
- The agent we are trying to contactcommunicationReach
- the sender agent's com capability- Returns:
- true if the receiver is within reach
-