Package eu.su.mas.dedale.env.jme
Class jmeEnvironment
java.lang.Object
eu.su.mas.dedale.env.jme.jmeEnvironment
- All Implemented Interfaces:
IEnvironment
-
Constructor Summary
-
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
CreateEnvironment
(String topologyConfigurationFilePath, String instanceConfiguration, boolean isGrid, Integer envSize, boolean diamond, boolean gold, boolean well) Deprecated.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 agentName) 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)
-
Constructor Details
-
jmeEnvironment
public jmeEnvironment()
-
-
Method Details
-
CreateEnvironment
public void CreateEnvironment(GeneratorType g, String topologyConfigurationFilePath, String instanceConfiguration, boolean diamond, boolean gold, boolean well, Integer... topologyParameters) Description copied from interface:IEnvironment
Create an environment.- Specified by:
CreateEnvironment
in interfaceIEnvironment
- 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,..
-
CreateEnvironment
public void CreateEnvironment(String topologyConfigurationFilePath, String instanceConfiguration, boolean isGrid, Integer envSize, boolean diamond, boolean gold, boolean well) Deprecated. -
deployEntity
Description copied from interface:IEnvironment
Add an entity to the graph- Specified by:
deployEntity
in interfaceIEnvironment
- 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
- Specified by:
removeEntity
in interfaceIEnvironment
-
getCurrentPosition
- Specified by:
getCurrentPosition
in interfaceIEnvironment
- Parameters:
agentName
- Name of the agent to locate- Returns:
- The entity current position, null if the entity is not in the environment
-
observe
public List<dataStructures.tuple.Couple<Location,List<dataStructures.tuple.Couple<Observation, observeString>>>> (Location currentPosition, String agentName) - Specified by:
observe
in interfaceIEnvironment
- 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
- Specified by:
moveTo
in interfaceIEnvironment
- 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
- Specified by:
pick
in interfaceIEnvironment
- 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
-
isReachable
- Specified by:
isReachable
in interfaceIEnvironment
- 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
-
dropOff
Description copied from interface:IEnvironment
This methods can only be called by specific types of agents. For the others it will do nothing.- Specified by:
dropOff
in interfaceIEnvironment
- 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
- Specified by:
throwGrenade
in interfaceIEnvironment
- Parameters:
agentName
- The name of the agent that is shootinglocationId
- the id of the room it aims at- Returns:
- true if done, false otherwise
-
getName
- Specified by:
getName
in interfaceIEnvironment
- Returns:
- The name of the environment
-
openLock
- Specified by:
openLock
in interfaceIEnvironment
- 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
- Specified by:
closeLock
in interfaceIEnvironment
- Parameters:
l
- 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
-