public abstract class SubsumptionAgent extends Agent
Constructor and Description |
---|
SubsumptionAgent(String name,
String team) |
Modifier and Type | Method and Description |
---|---|
static int |
getAnzangents() |
HelpFunctions |
getHelpFunctions() |
apltk.interpreter.data.LogicGoal |
getLastGoal() |
int |
getMoney() |
int |
getMyEnergy() |
int |
getMyHealth() |
int |
getMyID() |
String |
getMyLastAction() |
String |
getMyLastActionResult() |
int |
getMyMaxEnergy() |
int |
getMyMaxEnergyDisabled() |
int |
getMyMaxHealth() |
String |
getMyName() |
String |
getMyPos() |
abstract String |
getMyRole() |
int |
getMyStrength() |
String |
getMyTeam() |
Vector<Rule> |
getRelation() |
int |
getRussianCounter() |
int |
getStep() |
int |
getZoneStart() |
void |
handlePercept(eis.iilang.Percept p)
This method is called if the environment-interface sends a
percept as a notification.
|
boolean |
initDirectEdges(Collection<eis.iilang.Percept> percepts)
Initiates the Topology-Map Creates a (NxN)-Matrix with an edges value
|
eis.iilang.Action |
processAction(InternalAction a,
Collection<apltk.interpreter.data.LogicBelief> beliefs,
Collection<apltk.interpreter.data.LogicGoal> goals) |
boolean |
processMessages(Collection<apltk.interpreter.data.Message> messages,
Collection<eis.iilang.Percept> percepts)
evaluates the MailBox, updates BeliefBase with others agents information,
receive topology from agents which I can see now
|
protected boolean |
removeBelief(apltk.interpreter.data.LogicBelief deleteThis) |
boolean |
removeGoal(apltk.interpreter.data.LogicGoal deleteThis) |
void |
removeLastGoal() |
eis.iilang.Action |
selectAction()
main control function; updates belief and goal base, find the possible
action with the highest priority and process it further if it is an
internalAction
|
boolean |
sendTopologyToUnseenAgents()
Agents send their topology information to all unseen agents
so that the message-receiver can check whether he and the sender
share at least one vertex (i.e. they see each other)
|
void |
setMoney(int money) |
void |
setMyEnergy(int myEnergy) |
void |
setMyHealth(int myHealth) |
void |
setMyID(int myID) |
void |
setMyLastAction(String myLastAction) |
void |
setMyLastActionResult(String myLastActionResult) |
void |
setMyMaxEnergy(int myMaxEnergy) |
void |
setMyMaxEnergyDisabled(int value) |
void |
setMyMaxHealth(int myMaxHealth) |
void |
setMyName(String myName) |
void |
setMyPos(String myPos) |
void |
setMyStrength(int value) |
void |
setMyTeam(String myTeam) |
void |
setStep(int step) |
eis.iilang.Action |
step()
Executes one step of the agent.
|
boolean |
updateUnseenAgents(Collection<eis.iilang.Percept> percepts,
Collection<apltk.interpreter.data.Message> messages)
Checks whether a new agent can be seen.
|
addBelief, addGoal, broadcastBelief, clearBeliefs, clearGoals, containsBelief, containsGoal, createAgentFromClass, equals, getAllBeliefs, getAllPercepts, getBeliefBase, getEnvironmentInterface, getGoalBase, getMessages, getName, getTeam, hashCode, println, removeBeliefs, removeGoals, sendMessage, setEnvironmentInterface
public abstract String getMyRole()
public void handlePercept(eis.iilang.Percept p)
Agent
getAllPercepts
method which
yields all percepts.handlePercept
in class Agent
p
- the percept to be handledpublic eis.iilang.Action step()
Agent
public eis.iilang.Action selectAction()
-
- step()
public eis.iilang.Action processAction(InternalAction a, Collection<apltk.interpreter.data.LogicBelief> beliefs, Collection<apltk.interpreter.data.LogicGoal> goals)
the
- internalAction which to process, percepts/beliefs/goalsselectAction()
public boolean initDirectEdges(Collection<eis.iilang.Percept> percepts)
Collection
- selectAction()
public boolean processMessages(Collection<apltk.interpreter.data.Message> messages, Collection<eis.iilang.Percept> percepts)
all
- percepts and messagesselectAction()
public boolean updateUnseenAgents(Collection<eis.iilang.Percept> percepts, Collection<apltk.interpreter.data.Message> messages)
percepts
- messages
- public boolean sendTopologyToUnseenAgents()
-
- selectAction()
public boolean removeGoal(apltk.interpreter.data.LogicGoal deleteThis)
LogicGoal
- deleteThis (the goal which should be deleted)protected boolean removeBelief(apltk.interpreter.data.LogicBelief deleteThis)
LogicGoal
- deleteThis (the belief which should be deleted)public void removeLastGoal()
public apltk.interpreter.data.LogicGoal getLastGoal()
public static int getAnzangents()
public int getZoneStart()
public String getMyName()
public int getMyID()
public String getMyTeam()
public int getMyEnergy()
public int getMyMaxEnergy()
public int getMyMaxEnergyDisabled()
public int getMyHealth()
public int getMyMaxHealth()
public int getMyStrength()
public String getMyPos()
public String getMyLastActionResult()
public int getStep()
public int getMoney()
public String getMyLastAction()
public HelpFunctions getHelpFunctions()
public int getRussianCounter()
public void setMyName(String myName)
public void setMyID(int myID)
public void setMyTeam(String myTeam)
public void setMyEnergy(int myEnergy)
public void setMyMaxEnergy(int myMaxEnergy)
public void setMyMaxEnergyDisabled(int value)
public void setMyHealth(int myHealth)
public void setMyMaxHealth(int myMaxHealth)
public void setMyStrength(int value)
public void setMyPos(String myPos)
public void setMyLastActionResult(String myLastActionResult)
public void setMyLastAction(String myLastAction)
public void setMoney(int money)
public void setStep(int step)
Copyright © 2013. All Rights Reserved.