|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.ie.cowbots.arch.EnvironmentAdapter
public abstract class EnvironmentAdapter
adapter to connect the cowbot architecture with an environment. new perceptions are stored in a first-in first-out queue. the adatper should also manage the connection to an environment in case of disconnects, etc.
Field Summary | |
---|---|
protected java.util.concurrent.locks.ReentrantLock |
envLock
|
protected boolean |
hasNewPercepts
|
protected java.util.List<Literal> |
newEndPer
|
protected java.util.List<Literal> |
newEnvPer
|
protected java.util.List<Literal> |
newSimPer
|
protected AgArch |
owner
|
Constructor Summary | |
---|---|
EnvironmentAdapter(AgArch owner)
|
Method Summary | |
---|---|
void |
acquire()
aquires access to environment adapter for the calling thread. the thread might be blocked until the percepts can be aquired. |
(package private) abstract void |
act(java.lang.String action)
send an action to the environment |
java.util.List<Literal> |
getPercepts()
returns the agent's perceptions as a list of literals. might return null if no new perception are available. |
abstract int |
getWorldTime()
|
void |
newEndOfSimulation(java.util.List<Literal> perEnd)
this method is called whenever new end of simulation data are avail. |
void |
newPercepts(java.util.List<Literal> per)
this method is called when new environmental percepts are available. |
void |
newSimulation(java.util.List<Literal> perSim)
this method queues information about a new simulation (a new environment the agent competes in). an agent should always setup |
void |
release()
releases access lock hold by the caller. has to be called whenever a caller acquired the environmental adapter for data update or retrieval. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected AgArch owner
protected java.util.List<Literal> newSimPer
protected java.util.List<Literal> newEndPer
protected java.util.List<Literal> newEnvPer
protected java.util.concurrent.locks.ReentrantLock envLock
protected boolean hasNewPercepts
Constructor Detail |
---|
public EnvironmentAdapter(AgArch owner)
Method Detail |
---|
public abstract int getWorldTime()
public java.util.List<Literal> getPercepts()
public void acquire()
public void release()
abstract void act(java.lang.String action)
action
- public void newPercepts(java.util.List<Literal> per)
per
- list of new perceptionspublic void newSimulation(java.util.List<Literal> perSim)
perSim
- data block for simulation startpublic void newEndOfSimulation(java.util.List<Literal> perEnd)
perEnd
- data block for simulation end
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |