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 Type Method Description boolean
closeLock(Location location)
void
CreateEnvironment(GeneratorType g, java.lang.String topologyConfigurationFilePath, java.lang.String instanceConfiguration, boolean diamond, boolean gold, boolean well, java.lang.Integer... topologyParameters)
Create an environment.void
CreateEnvironment(java.lang.String topologyConfigurationFilePath, java.lang.String instanceConfiguration, boolean isGrid, java.lang.Integer envSize, boolean diamond, boolean gold, boolean well)
Deprecated.All existing features are not available in randomly generated env : Treasure Locks,..void
deployEntity(java.lang.String entityName, EntityCharacteristics e, Location locationId)
Add an entity to the graphboolean
dropOff(Location location, ElementType e, java.lang.Integer quantity)
This methods can only be called by specific types of agents.Location
getCurrentPosition(java.lang.String entityName)
java.lang.String
getName()
boolean
isReachable(java.lang.String senderName, java.lang.String receiverName, int communicationReach)
java.lang.Integer
moveTo(java.lang.String entityName, EntityCharacteristics ec, Location targetedPosition)
java.util.List<dataStructures.tuple.Couple<Location,java.util.List<dataStructures.tuple.Couple<Observation,java.lang.Integer>>>>
observe(Location currentPosition, java.lang.String agentName)
boolean
openLock(java.lang.String entityName, Location location, ElementType e)
int
pick(java.lang.String entityName, Location location, ElementType e, java.lang.Integer maxQuantity)
void
removeEntity(java.lang.String entityName, EntityCharacteristics e)
boolean
throwGrenade(java.lang.String agentName, Location locationId)
-
Method Details
-
CreateEnvironment
void CreateEnvironment(java.lang.String topologyConfigurationFilePath, java.lang.String instanceConfiguration, boolean isGrid, java.lang.Integer envSize, boolean diamond, boolean gold, boolean well)Deprecated.All existing features are not available in randomly generated env : Treasure Locks,..Create an environment.- Parameters:
topologyConfigurationFilePath
- FullPath to the file describing it. If the environment is autogenerated, null .instanceConfiguration
- FullPath to the file describing it. If the environment is autogenerated, null.isGrid
- true id the generated environment is a gridenvSize
- size of the generated environmentdiamond
- true if diamond have to be generatedgold
- true if gold have to be generatedwell
- true if wells have to be generated
-
CreateEnvironment
void CreateEnvironment(GeneratorType g, java.lang.String topologyConfigurationFilePath, java.lang.String instanceConfiguration, boolean diamond, boolean gold, boolean well, java.lang.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
java.lang.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
java.util.List<dataStructures.tuple.Couple<Location,java.util.List<dataStructures.tuple.Couple<Observation,java.lang.Integer>>>> observe(Location currentPosition, java.lang.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
java.lang.Integer moveTo(java.lang.String entityName, EntityCharacteristics ec, Location targetedPosition)- 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
int pick(java.lang.String entityName, Location location, ElementType e, java.lang.Integer maxQuantity)- 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:
e
- Type of resource to unlock in the environment (Currently only gold or diamond )entityName
- the name of the entitylocation
- the position to pick the resource- 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
boolean isReachable(java.lang.String senderName, java.lang.String receiverName, int communicationReach)- 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
-