mas.agents0815
Class SubsumptionAgent

java.lang.Object
  extended by massim.javaagents.Agent
      extended by mas.agents0815.SubsumptionAgent
Direct Known Subclasses:
AgentAggressiveSentinel, AgentDefender, AgentDummy, AgentExplorer, AgentInspector, AgentRepairer, AgentSaboteur, AgentSentinel

public abstract class SubsumptionAgent
extends Agent


Field Summary
 
Fields inherited from class massim.javaagents.Agent
beliefs, goals
 
Constructor Summary
SubsumptionAgent(java.lang.String name, java.lang.String team)
           
 
Method Summary
static int getAnzangents()
           
 HelpFunctions getHelpFunctions()
           
 apltk.interpreter.data.LogicGoal getLastGoal()
           
 int getMoney()
           
 int getMyEnergy()
           
 int getMyHealth()
           
 int getMyID()
           
 java.lang.String getMyLastAction()
           
 java.lang.String getMyLastActionResult()
           
 int getMyMaxEnergy()
           
 int getMyMaxEnergyDisabled()
           
 int getMyMaxHealth()
           
 java.lang.String getMyName()
           
 java.lang.String getMyPos()
           
abstract  java.lang.String getMyRole()
           
 int getMyStrength()
           
 java.lang.String getMyTeam()
           
 java.util.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(java.util.Collection<eis.iilang.Percept> percepts)
          Initiates the Topology-Map Creates a (NxN)-Matrix with an edges value
 eis.iilang.Action processAction(InternalAction a, java.util.Collection<apltk.interpreter.data.LogicBelief> beliefs, java.util.Collection<apltk.interpreter.data.LogicGoal> goals)
           
 boolean processMessages(java.util.Collection<apltk.interpreter.data.Message> messages, java.util.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(java.lang.String myLastAction)
           
 void setMyLastActionResult(java.lang.String myLastActionResult)
           
 void setMyMaxEnergy(int myMaxEnergy)
           
 void setMyMaxEnergyDisabled(int value)
           
 void setMyMaxHealth(int myMaxHealth)
           
 void setMyName(java.lang.String myName)
           
 void setMyPos(java.lang.String myPos)
           
 void setMyStrength(int value)
           
 void setMyTeam(java.lang.String myTeam)
           
 void setStep(int step)
           
 eis.iilang.Action step()
          Executes one step of the agent.
 boolean updateUnseenAgents(java.util.Collection<eis.iilang.Percept> percepts, java.util.Collection<apltk.interpreter.data.Message> messages)
          Checks whether a new agent can be seen.
 
Methods inherited from class massim.javaagents.Agent
addBelief, addGoal, broadcastBelief, clearBeliefs, clearGoals, containsBelief, containsGoal, createAgentFromClass, equals, getAllBeliefs, getAllPercepts, getBeliefBase, getEnvironmentInterface, getGoalBase, getMessages, getName, getTeam, hashCode, println, removeBeliefs, removeGoals, sendMessage, setEnvironmentInterface
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubsumptionAgent

public SubsumptionAgent(java.lang.String name,
                        java.lang.String team)
Method Detail

getMyRole

public abstract java.lang.String getMyRole()

getRelation

public java.util.Vector<Rule> getRelation()

handlePercept

public void handlePercept(eis.iilang.Percept p)
Description copied from class: Agent
This method is called if the environment-interface sends a percept as a notification. Note, that sending percepts-via-notifications must be explicitely activated for the environment-interface. An alternative is to use the getAllPercepts method which yields all percepts.

Specified by:
handlePercept in class Agent
Parameters:
p - the percept to be handled

step

public eis.iilang.Action step()
Description copied from class: Agent
Executes one step of the agent. This method is assumed to terminate in appropriate time.

Specified by:
step in class Agent

selectAction

public 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

Parameters:
- -
Returns:
ExternalAction item to send to the server
See Also:
step()

processAction

public eis.iilang.Action processAction(InternalAction a,
                                       java.util.Collection<apltk.interpreter.data.LogicBelief> beliefs,
                                       java.util.Collection<apltk.interpreter.data.LogicGoal> goals)
Parameters:
the - internalAction which to process, percepts/beliefs/goals
Returns:
hopefully an externalAction which can be send to the server
See Also:
selectAction()

initDirectEdges

public boolean initDirectEdges(java.util.Collection<eis.iilang.Percept> percepts)
Initiates the Topology-Map Creates a (NxN)-Matrix with an edges value

Parameters:
Collection - percepts
Returns:
boolean, success indicator of the function
See Also:
selectAction()

processMessages

public boolean processMessages(java.util.Collection<apltk.interpreter.data.Message> messages,
                               java.util.Collection<eis.iilang.Percept> percepts)
evaluates the MailBox, updates BeliefBase with others agents information, receive topology from agents which I can see now

Parameters:
all - percepts and messages
Returns:
boolean, success indicator of the function
See Also:
selectAction()

updateUnseenAgents

public boolean updateUnseenAgents(java.util.Collection<eis.iilang.Percept> percepts,
                                  java.util.Collection<apltk.interpreter.data.Message> messages)
Checks whether a new agent can be seen.

Parameters:
percepts -
messages -
Returns:
true if something changes, and we see an unknown agent

sendTopologyToUnseenAgents

public 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)

Parameters:
- -
Returns:
boolean, success indicator of the function
See Also:
selectAction()

removeGoal

public boolean removeGoal(apltk.interpreter.data.LogicGoal deleteThis)
Parameters:
LogicGoal - deleteThis (the goal which should be deleted)
Returns:
true if the goal was found in goalBase

removeBelief

protected boolean removeBelief(apltk.interpreter.data.LogicBelief deleteThis)
Parameters:
LogicGoal - deleteThis (the belief which should be deleted)
Returns:
true if the belief was found in beliefBase

removeLastGoal

public void removeLastGoal()

getLastGoal

public apltk.interpreter.data.LogicGoal getLastGoal()
Returns:
LogicGoal

getAnzangents

public static int getAnzangents()

getZoneStart

public int getZoneStart()

getMyName

public java.lang.String getMyName()

getMyID

public int getMyID()

getMyTeam

public java.lang.String getMyTeam()

getMyEnergy

public int getMyEnergy()

getMyMaxEnergy

public int getMyMaxEnergy()

getMyMaxEnergyDisabled

public int getMyMaxEnergyDisabled()

getMyHealth

public int getMyHealth()

getMyMaxHealth

public int getMyMaxHealth()

getMyStrength

public int getMyStrength()

getMyPos

public java.lang.String getMyPos()

getMyLastActionResult

public java.lang.String getMyLastActionResult()

getStep

public int getStep()

getMoney

public int getMoney()

getMyLastAction

public java.lang.String getMyLastAction()

getHelpFunctions

public HelpFunctions getHelpFunctions()

getRussianCounter

public int getRussianCounter()

setMyName

public void setMyName(java.lang.String myName)

setMyID

public void setMyID(int myID)

setMyTeam

public void setMyTeam(java.lang.String myTeam)

setMyEnergy

public void setMyEnergy(int myEnergy)

setMyMaxEnergy

public void setMyMaxEnergy(int myMaxEnergy)

setMyMaxEnergyDisabled

public void setMyMaxEnergyDisabled(int value)

setMyHealth

public void setMyHealth(int myHealth)

setMyMaxHealth

public void setMyMaxHealth(int myMaxHealth)

setMyStrength

public void setMyStrength(int value)

setMyPos

public void setMyPos(java.lang.String myPos)

setMyLastActionResult

public void setMyLastActionResult(java.lang.String myLastActionResult)

setMyLastAction

public void setMyLastAction(java.lang.String myLastAction)

setMoney

public void setMoney(int money)

setStep

public void setStep(int step)


Copyright © 2012. All Rights Reserved.