bot
Class EmotionalBot

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.AbstractAgent
      extended by cz.cuni.amis.pogamut.base.agent.AbstractObservingAgent<WORLD_VIEW>
          extended by cz.cuni.amis.pogamut.base.agent.AbstractGhostAgent<WORLD_VIEW>
              extended by cz.cuni.amis.pogamut.base.agent.AbstractEmbodiedAgent<WORLD_VIEW>
                  extended by cz.cuni.amis.pogamut.ut2004.bot.AbstractUT2004Bot<WorldView>
                      extended by cz.cuni.amis.pogamut.ut2004.bot.ThreadedUT2004Bot<WorldView>
                          extended by cz.cuni.amis.pogamut.ut2004.bot.SyncUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>
                              extended by bot.EmotionalBot
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.agent.IAgent, cz.cuni.amis.pogamut.base.utils.IControllable
Direct Known Subclasses:
EmotionalFemaleBot, EmotionalMaleBot

public class EmotionalBot
extends cz.cuni.amis.pogamut.ut2004.bot.SyncUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>

The base class for our emotional agents. Defines sensors and actions for our emotion agents. Also registers all listeners to messages from the environment as well as creates all other objects needed for our agent (ALMA emotion model...). Moreover here are defined the constants which affect the agent behavior.


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.base.agent.AbstractGhostAgent
cz.cuni.amis.pogamut.base.agent.AbstractGhostAgent.AgentAct
 
Field Summary
 cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo agentInfo
          Information about agent state
 java.util.ArrayList<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> agentInterrupters
          Here we hold all agents that spoke to us recently or interrupted us in some other way - so we can react to them (by going to interrupted state or setting one of them as agentWith) or throw them out of this list
 AgentLogging agentLog
          Object we will log into if complex logging enabled
 cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agentWith
          Agent our agent is with now.
 double agentWithDissapearTimeConst
          When we don't see the agentWith, after this time we will consider him as dissapeared
 double approachFeelingConst
          Feeling we need to approach the player if we see to pass him by
 double argumentLeaveFeelingThresholdConst
          We will accept leave proposal, if our feelings are less negative toward the agent than this value
private static double AVOID_OBSTACLE_FUNCTION
          OBSTACLE AVOIDANCE:
private static double AVOID_OBSTACLE_FUNCTION_MULTI
           
private static double AVOID_OBSTACLE_MIN_DISTANCE
           
private static double AVOID_OBSTACLE_RUN_VECTOR_LENGTH
           
 boolean bLogEnabled
          If true, the logging of the scenario into complex object will be enabled
 boolean botMoving
          True if bot moving, false otherwise
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location boyHomeLocation
          Boy home location
 double cinemaDelayTimeConst
          When we were at the cinema, we will propose new go to cinema after this time seconds
 double cinemaFeelingConst
          Feeling value for going to cinema
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location cinemaLocation
          Cinema location
 double cinemaRejectFeelingConst
          If feeling lower than this, it will reject cinema request (otherwise, it will be just ignored)
 int communicationRangeConst
          How close the agent should for us to communicate with him or to allow to interrupter us.
 double complimentFeelingConst
          Feeling needed to make compliment to the agent
 double complimentJoyConst
          Intensity we need for joy to perform action compliment
 double cuddleFeelingConst
          Feeling value for refusing to leave target that we are cuddling
 double cuddleTimeConst
          Time value after we will accept leave proposal when we are cuddling something
 double currentTime
          Here we keep current time in the scenario.
protected  int feelingsDecayCounter
          Helper var, here we store feeling decay counter.
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location firstGirlHomeLocation
          First girl home location - for Anne.
 double flowerDelayTimeConst
          Second between two flower gives
 double flowerFeelingConst
          Feeling value when we want to give flowers to target
 int followAgentDistanceConst
          We will keep this distance between agent and us when we will follow him
 cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game game
          Information about game
 java.util.HashMap<EventId,java.lang.Boolean> generatedEvents
          Here is the list of events we will generate in the scenario
 int generateWaitEventDurationConst
          We will generate wait emotional event every this value seconds
 int homeDelayTimeConst
          After this time when we are not at home we will propose home proposal
 double homeFeelingConst
          Feeling value for going home with some agent
 double homeRejectFeelingConst
          If feeling lower than this, it will reject home request (otherwise, it will be just ignored)
 int humanInterruptedDelayConst
          If we were interrupted in last x secs by human agent we won't let him to interrupt us now
 int checkAgentBackDelayTimeConst
          We will start checking if agent is back after this time
 double ignoreFeelingConst
          Feeling value for ignoring agents
 java.lang.String initAgentWithName
          For setting the scenario up, this will be our first agentWith.
 int initWaitDurationConst
          For this time we won't check if the agent is back, so he has chance to leave
 double insultAngerConst
          Intensity we need for anger to perform action insult
 double insultFeelingConst
          Feeling needed to make an insult to target agent
 double interruptDelayConst
          If someone has interrupted us before this amount of time, we won't let him to interrupt us again (we will say BYE to him immediately)
 int interruptDurationConst
          This number will be used when setting up interruption timer duration, this + random number up to this value so max interruption duration will be 2 * this number)
 double kickEmoFeelingConst
          Feeling value for kicking emohawk
 double kissDelayTimeConst
          Delay between two kiss proposals
 double kissFeelingConst
          Feeling value for proposing/accepting kiss
 java.util.HashMap<cz.cuni.amis.pogamut.ut2004.communication.messages.UnrealId,cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPoint> knownNavPoints
          List of all navpoints in the map - got from MapListObtainedEvent
protected  double lastActionDuration
          Duration of the last action
protected  double lastActionTime
          Time of the last action
protected  ActionType lastActionType
          Type of the last action
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location lastFollowPathLocation
          We will check this in our navigation method if our path is still actual if not, we will request a new path
protected  double lastWaitEventTime
          Last time we have generated wait event
 double leaveFeelingConst
          Feeling value for leaving actual agentWith
 double loveFeelingConst
          Feeling value for real love
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location meetingCinemaLocation
          This should point in front of the cinema
 double messageFadeOutConst
          In seconds how long the text bubbles will stay above the bot.
 int messageResponseDelayConst
          Delay before we will responed to some message
 int messageSendDelayConst
          Delay before we will send new message if no response was sent to us
 double minimalActionDelayConst
          Minimal time between two actions we can do toward the agent.
 double minimalActionResponseDelayConst
          Minimal time between we choose to respond to some other player action
 AEventGenerator myAEGenerator
          Pointer to class that evaluates events by OCC variables and notifies ALMA
 PogamutALMA myALMA
          Pointer to ALMA emotion model
 cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myBegListener
          Listener to Beg Message
 cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myBotDamagedListener
          Listener to Dam Message
 cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myBotDiedListener
          Listener to Die Message
 java.lang.String myClassName
          Name of the UT class that will be used for visualizing our agent in the envirnoment
 java.util.HashMap<java.lang.Integer,ConversationInfo> myConversationHistory
          This logs the number of messages we have received from players, so we can adjust emotion events intensity
 EventGenerator myEGenerator
          Pointer to class that generates events according to messages we got from environment
 AEmotionState myEmotionState
          Class that counts feeling towards agents and provide simple interface between ALMA
 cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myEndListener
          Listens to End Message
 PlaceType myGoalPlace
          This is my destination place, so I know where I am going to - MY_HOME, CINEMA, etc.
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location myGoalTarget
          This is the point where I am heading to rights now - may be far away, this will be used by state AGENT_GOING_SOMEWHERE_WITH
 cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myGotInvListener
          Listener to GOT Message
 java.util.ArrayList<ItemRequest> myItemRequests
          Holds all item requests we have received
 java.util.HashMap<ScenarioItemType,java.lang.Integer> myItems
          Holds all my scenario items
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location myLocTarget
          Helper variable.
 cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myMapListObtainedListener
          Here we will listen to map event and store all nav points in our internals
protected  java.lang.String myName
          Our agents name
 java.util.ArrayList<cz.cuni.amis.pogamut.base3d.worldview.objects.ILocated> myPath
          Here we store latest path we got from GameBots
 cz.cuni.amis.pogamut.base.agent.navigation.PathPlannerListener myPathListener
          Path listener
 cz.cuni.amis.pogamut.ut2004.agent.navigation.UTAstar myPathPlanner
          Path finding module
 cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myPickupListener
          Listener to IPK Message
 cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myPlayerDamagedListener
          Listener to Hit Message
 cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myPlayerKilledListener
          Listener to Kill Message - should not be used in scenario right now
 cz.cuni.amis.pogamut.base.agent.worldview.WorldObjectEventListener myPlrListener
          Listener to PLR message - information about agents we see.
 cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player myPlrTarget
          Helper variable.
 java.lang.String mySkin
          Name of the skin that will be used to visualize our agent, not used if class set
 cz.cuni.amis.pogamut.base.agent.worldview.WorldObjectEventListener mySlfListener
          Listener to SLF message containing information about our agent.
 cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myTextMessageListener
          Listener to global chat message - text messages
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location nearestNavLocation
          This is navigation point closest to our goalTarget
 java.util.HashMap<java.lang.Integer,ConversationInfo> otherConversationHistory
          This logs the emotional conversations send to other agents than we are
 double parkDelayTimeConst
          When we were at park, we will propose new go to park after this time seconds
 double parkFeelingConst
          Feeling value for going to park
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location parkLocation
          Park location
 double parkRejectFeelingConst
          If feeling lower than this, it will reject park request (otherwise, it will be just ignored)
 boolean pathReceived
          True if we have already received path to our latest goal
 boolean pathRequested
          True if we have already requested path to our latest goal
 double pathRequestedTime
          Time of our last path request
 int pathRerequestDelay
          If we haven't received path in this time seconds, we will request it again
 cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Players players
          Information about other agents we can see or have seen
 java.util.HashMap<java.lang.Integer,PlayerInfo> playersHistory
          This helps us to generate player appeared, lost and player together events
 java.util.HashMap<java.lang.Integer,cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> playersIgnored
          Here we store agents that are ignored by us for some reasons
 java.util.HashMap<java.lang.Integer,PolymorphEventInfo> polymorphHistory
          Here we store info about last polymorph triggered events, so they don't occur too often
 int polymorphInterruptedDelayConst
          This is the time that has to pass after last polymorph interruption before we let him to interrupt us again
protected  StateType previousState
          Previous state our agent was in.
 int proposalIgnoreTimeConst
          If player haven't responded to our proposal in specified time, we will count it as ignored
 java.util.HashMap<java.lang.Integer,java.util.ArrayList<ProposalInfo>> proposalsHistory
          History of our sent proposals
 java.util.ArrayList<cz.cuni.amis.pogamut.base3d.worldview.objects.Location> randomLocationTargets
          Here we define places the agent can go, when moving randomly to avoid navigation problems
 double reapproachDelayConst
          Time after we will try again to approach agent after we have left/been left (by bye or leave)
 double recentActionTimeConst
          Action done max before this time is still taken as recent - used in pickAction()
 ProposalInfo recentProposal
          Recent proposal we have sent to someone.
 ProposalInfo recentReceivedProposal
          Recent proposal we have received from someone - used for responding to such proposal.
 ScenarioType scenario
          Here we store which scenario we are currently performing
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location secondGirlHomeLocation
          First girl home location - for Clementine.
 double sexDelayTimeConst
          Delay between two sex proposals
 double sexFeelingConst
          Feeling we need to make proposal to have sex and to accept this proposal
 double slapAngerConst
          Intensity we need for anger to perform action slap
 double slapFeelingConst
          Feeling value for willing to slap someone
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location startLocation
          Initial agent location
 cz.cuni.amis.pogamut.base3d.worldview.objects.Rotation startRotation
          Initial agent rotation
protected  StateType state
          Our agent current state
 double stayWithAgentBonusFeelingConst
          When responding to proposal to leave agentWith, the feeling to proposing agent needs to be higher than the agentWith feeling plus this bonus!
 java.util.HashMap<TimerType,java.lang.Double> timersDelayTime
          Duration times of our timers
 java.util.HashMap<TimerType,java.lang.Double> timersTriggerTime
          Trigger times of our timers
 int waitAtHomeDurationConst
          This is default duration const, the timer will be set to this value + random from 0 to this value / 4. after this time, the agent will stop waiting
 int waitDurationConst
          this is default duration const, the timer will be set to this value + random from 0 to this value / 4. after this time, the agent will stop waiting TODO: feeling affects waitDuration?
 double waitFeelingConst
          Feeling we need to wait for the agent
 cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player waitForAgent
          player we are waiting for in the wait state.
 double waitRejectFeelingConst
          feeling we need to have to reject wait proposal from agentWith
 int walkDurationTimeConst
          How long the walk with other agent will last
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.ThreadedUT2004Bot
logicAlive, logicRunning, logicShouldBeAlive, logicShouldRun, logicThread
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.AbstractAgent
DEFAULT_AGENT_TIMEOUT_MILLIS
 
Constructor Summary
EmotionalBot(cz.cuni.amis.pogamut.base.utils.logging.AgentLogger logger, cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView worldView, cz.cuni.amis.pogamut.base.communication.commands.ICommandSerializer commandSerializer)
          Constructor for our agent.
 
Method Summary
protected  void actionBye(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          We will tell bye to the agent, that means we want to end contact with him for now.
protected  void actionCompliment(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          We will compliment the agent - should be used for humans.
protected  void actionCuddle(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          We will cuddle the agent - should be used for animals.
protected  void actionGiveItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player targetAgent, ScenarioItemType item)
          We will give target item to targetAgent if we have the item.
protected  void actionInsult(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          We will insult the agent - should be used for humans.
protected  void actionKick(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          We will kick the agent - should be used for animals.
protected  void actionKiss(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          We will kiss the agent.
protected  void actionLeave(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          We will leave the agent (leave the state AGENT_WITH) - we are probably angry on the agent, so we leave him at last.
protected  void actionMakeProposal(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent, ProposalType type)
          We will make input proposal to target agent.
protected  void actionMultipleBye(java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> values)
          We will send bye to all the input agents (should be used just for agent interrupters).
protected  void actionSex(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          We will have sex with the agent - should be made after SEX proposal was accepted.
protected  void actionSlap(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          We will slap the agent - should be used for humans.
private  cz.cuni.amis.pogamut.base3d.worldview.objects.Location[] adjustLocations(cz.cuni.amis.pogamut.base3d.worldview.objects.Location[] moveLocation)
          This will compute new Location to avoid hitting other players.
 boolean atCinema()
          Returns true if we are currently at cinema.
 boolean atHome(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          Returns true if we are currently at home of input agent.
 boolean atMyHome()
          Returns true if we are at our home location.
 boolean atPark()
          Returns true if we are currently at park.
protected  void beginState(StateType newState)
          This method is called when we enter a new state.
protected  void botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange config, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init)
          Called after the bot body is initialized in the environment.
protected  void botKilled(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotKilled event)
          Called each time our agent die in the environment.
private  void clearBotVariables()
          Completely resets the bot state - called when bot killed.
 void clearNavigationVariables()
          Clear path and recent location goals.
protected  void conversate(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player plr, ConversationType type)
          Basic conversation method.
protected  cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Initialize createInitializeCommand()
          Here we can set up our bot - his name and so.
 void doAction(ActionType type, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          Does input action towards target agent.
protected  void doLogic()
          Main method for our bot reasoning.
protected  void endState(StateType endingState)
          This method is called when some state ends.
private  double forceFunction(double x, double distance)
          Used by obstacle avoidance code.
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location getAgentHomeLocation(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          Returns home location for input agent, if don't know, boy home location will be used.
 PlaceType getAgentHomePlace(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          Returns home place for input agent.
 ConversationInfo getConversationHistory(int id)
          Returns conversation history between me and target agent (logs messages sent by the agent to us).
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location getDestinationLocation(PlaceType goalPlace)
          Returns actual location that we should head to if we want to reach input goal place!
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location getMyHomeLocation()
          Returns location of our home.
 java.lang.String getMyName()
          Returns agent name.
 java.lang.String getName(int id)
          Gets agents name from id (if possible).
 java.lang.String getName(java.lang.String el)
          Parses agent elicitor name.
protected  cz.cuni.amis.pogamut.base3d.worldview.objects.Location getNearestNavLocation(cz.cuni.amis.pogamut.base3d.worldview.objects.Location targetLocation)
          Returns nearest navigation point to input location in the map.
 ConversationInfo getOtherConversationHistory(int id)
          Returns conversation history for other agent (messages that were sent to him by other agents than we are).
 PlayerInfo getPlayerHistory(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pl)
          Returns PlayerInfo from playersHistory.
 java.util.HashMap<java.lang.Integer,PlayerInfo> getPlayersHistory()
          Getter for playersHistory.
 PolymorphEventInfo getPolymorphHistory(int id)
          Returns PolymorphInfo for input id.
 StateType getPreviousState()
          Returns agents previous state.
 StateType getState()
          Returns current agent state.
 boolean goToLocation(cz.cuni.amis.pogamut.base3d.worldview.objects.Location targetLocation)
          Goes to target location.
protected  void goToState(StateType newState)
          This method switches the bot to new state and notifies the bot - calls BeginState and EndState functions.
protected  boolean checkEmotionsIfWantProposal(int plrId, ProposalType type)
          Here we check emotions and feelings towards agent.
 boolean initScenario(ScenarioType type, java.lang.String agentName)
          Sets the bot internals according to the intput scenario.
 void insertInterrupter(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          If our interrupter list does not contaion input agent we will check if he passes all conditions to be added to the interrupter agents list and add him eventually.
 boolean isFemale(int id)
          Here we check if the agent specified by id is female.
 boolean isHuman(int id)
          Returns true if input id belongs to human being and not animal (also comupter controlled agents are human).
 boolean isHuman(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          Returns true if input agent is human being and not animal (also comupter controlled agents are human).
 boolean isMale(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          Here we check if the agent is male.
 boolean isOppositeSex(int id)
          Here we check if the agent specified by id is opposite sex then our agent TODO: Unfinished
 boolean isOppositeSex(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          Here we check if the agent specified by id is opposite sex then our agent TODO: Unfinished
private  void logAction(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent, ActionType type, double time, double duration)
          Logs input action towards input agent into log file.
protected  void logAgentState()
          Logs current emotions and feelings + agent state.
 void logEmotionEvent(de.affect.xml.AffectInputDocument.AffectInput ai, EventId event)
          Logs emotion event.
private  void logItemGiven(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent, ScenarioItemType item, double time)
          Logs item given to some agent.
 void logItemReceived(int agentId, java.lang.String agentName, ScenarioItemType item, double time)
          Logs item received from some agent.
private  void logProposal(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent, ProposalInfo newProp)
          Logs input proposal toward input agent to log file.
protected  void logStateEntered(StateType state, double time)
          Logs state entered.
protected  void logStateLeft(StateType state, double time)
          Logs state left.
 ScenarioItemType parseItemType(java.lang.String toString)
          Parses item type from input string.
 ProposalType parseProposalType(java.lang.String text)
          Parse proposal type from text.
protected  ActionType pickAction(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          Picks some action toward the agent based on the feeligns toward the agent, current agent situation (atCinema, atHome), our agent current state (INTERRUPT..)
 cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pickFocus(java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> values)
          Returns the player we should focus on now.
 cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pickHighestFeelingPlayer(java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> values)
          Choose the player (human) with the biggest feeling toward.
protected  cz.cuni.amis.pogamut.base3d.worldview.objects.Location pickNewLocTarget()
          Picks random location where we will head to.
protected  cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPoint pickNewNavTarget()
          Rendomly picks some navigation point to head to.
protected  void postPrepareBot(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo info)
          Called after the bot has body in the environment.
protected  void prePrepareBot()
          Called after the bot is set up in the platform, but BEFORE he has body in the environment or before any message from the environment arrives.
protected  boolean processMyProposal()
          Here we will check the status of our proposals and set the internal variables and state according to it or even perform actions.
protected  void removeAllInterrupters()
          Removes all from agentInterrupters.
protected  void removeInterrupter(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          Removes from agentInterrupters input agent, if he is there.
protected  boolean respondToProposal()
          Responds to proposal we've received from other agent and change our internal state accordingly!
protected  void setAction(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent, ActionType type, double time, double duration)
          Sets the action as current action and updates agent internals and player history.
 void showEmotions()
          Process the bots current emotions and sets the emotion emitter accordingly.
 void shutdown()
          Method called when the agent will be shutdown -
protected  void statePrepareScenario()
          This initial state will set up scenario for us.
 void throwExcp()
          This is a bad hack that allows us to run more experiments in a row in really easy way.
 void timerErase(TimerType timer)
          Immediately removes target timer from timers pool.
 void timerFinished(TimerType timer)
          Called anytime some timer is finished - it is not 100% accurate.
 double timerGetTriggerTime(TimerType timer)
          Gets trigger time of input timer, if none returs -1.
 boolean timerIsRunning(TimerType timer)
          Returns true if the timer is active and running.
 void timerProcess()
          Called every do doLogic method (in listener to BEG message).
 void timerSet(TimerType timer, double timerDelay)
          Sets the timer in our timer pool, timer starts running.
 java.util.ArrayList<TimerType> timersGetRunning()
          Returns all currently running timers.
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.SyncUT2004Bot
doBotLogic
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.ThreadedUT2004Bot
getBotAlive, getLastLogicRunMillis, getLogicPeriodMillis, kill, logicThreadCreated, pause, resume, setLogicPeriodMillis, start, stop
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.AbstractUT2004Bot
createPasswordReply, getGameInfo, getInitializeCommand, getPasswordReply, getWorldView, initCommandRequested, readyCommandRequested, setPassword
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.AbstractGhostAgent
getAct
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.AbstractAgent
addAgentJMXComponents, getAgentState, getAgentStopTimeoutMillis, getFolder, getJMX, getLogger, getName, log, logPlatform, setAgentState, setAgentState, setAgentStateDescription, terminate, terminate, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myName

protected java.lang.String myName
Our agents name


mySkin

public java.lang.String mySkin
Name of the skin that will be used to visualize our agent, not used if class set


myClassName

public java.lang.String myClassName
Name of the UT class that will be used for visualizing our agent in the envirnoment


myALMA

public PogamutALMA myALMA
Pointer to ALMA emotion model


myAEGenerator

public AEventGenerator myAEGenerator
Pointer to class that evaluates events by OCC variables and notifies ALMA


myEGenerator

public EventGenerator myEGenerator
Pointer to class that generates events according to messages we got from environment


myEmotionState

public AEmotionState myEmotionState
Class that counts feeling towards agents and provide simple interface between ALMA


cinemaLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location cinemaLocation
Cinema location


meetingCinemaLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location meetingCinemaLocation
This should point in front of the cinema


boyHomeLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location boyHomeLocation
Boy home location


firstGirlHomeLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location firstGirlHomeLocation
First girl home location - for Anne.


secondGirlHomeLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location secondGirlHomeLocation
First girl home location - for Clementine.


parkLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location parkLocation
Park location


startLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location startLocation
Initial agent location


startRotation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Rotation startRotation
Initial agent rotation


myPath

public java.util.ArrayList<cz.cuni.amis.pogamut.base3d.worldview.objects.ILocated> myPath
Here we store latest path we got from GameBots


pathRequested

public boolean pathRequested
True if we have already requested path to our latest goal


pathReceived

public boolean pathReceived
True if we have already received path to our latest goal


pathRequestedTime

public double pathRequestedTime
Time of our last path request


pathRerequestDelay

public int pathRerequestDelay
If we haven't received path in this time seconds, we will request it again


knownNavPoints

public java.util.HashMap<cz.cuni.amis.pogamut.ut2004.communication.messages.UnrealId,cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPoint> knownNavPoints
List of all navpoints in the map - got from MapListObtainedEvent


randomLocationTargets

public java.util.ArrayList<cz.cuni.amis.pogamut.base3d.worldview.objects.Location> randomLocationTargets
Here we define places the agent can go, when moving randomly to avoid navigation problems


agentWith

public cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agentWith
Agent our agent is with now. Important variable, when null it means our agent hasn't selected anyone to be with yet. With agentWith the agent can go to cinema, park and home.


initAgentWithName

public java.lang.String initAgentWithName
For setting the scenario up, this will be our first agentWith.


waitForAgent

public cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player waitForAgent
player we are waiting for in the wait state. Note: Not used!


agentInterrupters

public java.util.ArrayList<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> agentInterrupters
Here we hold all agents that spoke to us recently or interrupted us in some other way - so we can react to them (by going to interrupted state or setting one of them as agentWith) or throw them out of this list


myPlrTarget

public cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player myPlrTarget
Helper variable. Player I am heading to.


myLocTarget

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location myLocTarget
Helper variable. Location I am heading to


myGoalTarget

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location myGoalTarget
This is the point where I am heading to rights now - may be far away, this will be used by state AGENT_GOING_SOMEWHERE_WITH


nearestNavLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location nearestNavLocation
This is navigation point closest to our goalTarget


lastFollowPathLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location lastFollowPathLocation
We will check this in our navigation method if our path is still actual if not, we will request a new path


scenario

public ScenarioType scenario
Here we store which scenario we are currently performing


myGoalPlace

public PlaceType myGoalPlace
This is my destination place, so I know where I am going to - MY_HOME, CINEMA, etc.


botMoving

public boolean botMoving
True if bot moving, false otherwise


game

public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game game
Information about game


agentInfo

public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo agentInfo
Information about agent state


players

public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Players players
Information about other agents we can see or have seen


myPathPlanner

public cz.cuni.amis.pogamut.ut2004.agent.navigation.UTAstar myPathPlanner
Path finding module


lastActionTime

protected double lastActionTime
Time of the last action


lastActionDuration

protected double lastActionDuration
Duration of the last action


lastActionType

protected ActionType lastActionType
Type of the last action


proposalsHistory

public java.util.HashMap<java.lang.Integer,java.util.ArrayList<ProposalInfo>> proposalsHistory
History of our sent proposals


recentProposal

public ProposalInfo recentProposal
Recent proposal we have sent to someone. Used to check if it was accepted.


recentReceivedProposal

public ProposalInfo recentReceivedProposal
Recent proposal we have received from someone - used for responding to such proposal.


playersHistory

public java.util.HashMap<java.lang.Integer,PlayerInfo> playersHistory
This helps us to generate player appeared, lost and player together events


myItems

public java.util.HashMap<ScenarioItemType,java.lang.Integer> myItems
Holds all my scenario items


myItemRequests

public java.util.ArrayList<ItemRequest> myItemRequests
Holds all item requests we have received


bLogEnabled

public boolean bLogEnabled
If true, the logging of the scenario into complex object will be enabled


agentLog

public AgentLogging agentLog
Object we will log into if complex logging enabled


timersTriggerTime

public java.util.HashMap<TimerType,java.lang.Double> timersTriggerTime
Trigger times of our timers


timersDelayTime

public java.util.HashMap<TimerType,java.lang.Double> timersDelayTime
Duration times of our timers


generatedEvents

public java.util.HashMap<EventId,java.lang.Boolean> generatedEvents
Here is the list of events we will generate in the scenario


playersIgnored

public java.util.HashMap<java.lang.Integer,cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> playersIgnored
Here we store agents that are ignored by us for some reasons


polymorphHistory

public java.util.HashMap<java.lang.Integer,PolymorphEventInfo> polymorphHistory
Here we store info about last polymorph triggered events, so they don't occur too often


myConversationHistory

public java.util.HashMap<java.lang.Integer,ConversationInfo> myConversationHistory
This logs the number of messages we have received from players, so we can adjust emotion events intensity


otherConversationHistory

public java.util.HashMap<java.lang.Integer,ConversationInfo> otherConversationHistory
This logs the emotional conversations send to other agents than we are


state

protected StateType state
Our agent current state


previousState

protected StateType previousState
Previous state our agent was in.


currentTime

public double currentTime
Here we keep current time in the scenario. Is used by all classes.


feelingsDecayCounter

protected int feelingsDecayCounter
Helper var, here we store feeling decay counter.


lastWaitEventTime

protected double lastWaitEventTime
Last time we have generated wait event


loveFeelingConst

public double loveFeelingConst
Feeling value for real love


kissFeelingConst

public double kissFeelingConst
Feeling value for proposing/accepting kiss


cinemaFeelingConst

public double cinemaFeelingConst
Feeling value for going to cinema


parkFeelingConst

public double parkFeelingConst
Feeling value for going to park


homeFeelingConst

public double homeFeelingConst
Feeling value for going home with some agent


cinemaRejectFeelingConst

public double cinemaRejectFeelingConst
If feeling lower than this, it will reject cinema request (otherwise, it will be just ignored)


parkRejectFeelingConst

public double parkRejectFeelingConst
If feeling lower than this, it will reject park request (otherwise, it will be just ignored)


homeRejectFeelingConst

public double homeRejectFeelingConst
If feeling lower than this, it will reject home request (otherwise, it will be just ignored)


slapFeelingConst

public double slapFeelingConst
Feeling value for willing to slap someone


leaveFeelingConst

public double leaveFeelingConst
Feeling value for leaving actual agentWith


cuddleFeelingConst

public double cuddleFeelingConst
Feeling value for refusing to leave target that we are cuddling


argumentLeaveFeelingThresholdConst

public double argumentLeaveFeelingThresholdConst
We will accept leave proposal, if our feelings are less negative toward the agent than this value


ignoreFeelingConst

public double ignoreFeelingConst
Feeling value for ignoring agents


kickEmoFeelingConst

public double kickEmoFeelingConst
Feeling value for kicking emohawk


flowerFeelingConst

public double flowerFeelingConst
Feeling value when we want to give flowers to target


complimentFeelingConst

public double complimentFeelingConst
Feeling needed to make compliment to the agent


insultFeelingConst

public double insultFeelingConst
Feeling needed to make an insult to target agent


sexFeelingConst

public double sexFeelingConst
Feeling we need to make proposal to have sex and to accept this proposal


approachFeelingConst

public double approachFeelingConst
Feeling we need to approach the player if we see to pass him by


slapAngerConst

public double slapAngerConst
Intensity we need for anger to perform action slap


insultAngerConst

public double insultAngerConst
Intensity we need for anger to perform action insult


complimentJoyConst

public double complimentJoyConst
Intensity we need for joy to perform action compliment


stayWithAgentBonusFeelingConst

public double stayWithAgentBonusFeelingConst
When responding to proposal to leave agentWith, the feeling to proposing agent needs to be higher than the agentWith feeling plus this bonus!


waitFeelingConst

public double waitFeelingConst
Feeling we need to wait for the agent


waitRejectFeelingConst

public double waitRejectFeelingConst
feeling we need to have to reject wait proposal from agentWith


cuddleTimeConst

public double cuddleTimeConst
Time value after we will accept leave proposal when we are cuddling something


flowerDelayTimeConst

public double flowerDelayTimeConst
Second between two flower gives


cinemaDelayTimeConst

public double cinemaDelayTimeConst
When we were at the cinema, we will propose new go to cinema after this time seconds


parkDelayTimeConst

public double parkDelayTimeConst
When we were at park, we will propose new go to park after this time seconds


homeDelayTimeConst

public int homeDelayTimeConst
After this time when we are not at home we will propose home proposal


reapproachDelayConst

public double reapproachDelayConst
Time after we will try again to approach agent after we have left/been left (by bye or leave)


minimalActionDelayConst

public double minimalActionDelayConst
Minimal time between two actions we can do toward the agent.


minimalActionResponseDelayConst

public double minimalActionResponseDelayConst
Minimal time between we choose to respond to some other player action


messageFadeOutConst

public double messageFadeOutConst
In seconds how long the text bubbles will stay above the bot.


sexDelayTimeConst

public double sexDelayTimeConst
Delay between two sex proposals


kissDelayTimeConst

public double kissDelayTimeConst
Delay between two kiss proposals


recentActionTimeConst

public double recentActionTimeConst
Action done max before this time is still taken as recent - used in pickAction()


interruptDelayConst

public double interruptDelayConst
If someone has interrupted us before this amount of time, we won't let him to interrupt us again (we will say BYE to him immediately)


agentWithDissapearTimeConst

public double agentWithDissapearTimeConst
When we don't see the agentWith, after this time we will consider him as dissapeared


interruptDurationConst

public int interruptDurationConst
This number will be used when setting up interruption timer duration, this + random number up to this value so max interruption duration will be 2 * this number)


humanInterruptedDelayConst

public int humanInterruptedDelayConst
If we were interrupted in last x secs by human agent we won't let him to interrupt us now


polymorphInterruptedDelayConst

public int polymorphInterruptedDelayConst
This is the time that has to pass after last polymorph interruption before we let him to interrupt us again


messageResponseDelayConst

public int messageResponseDelayConst
Delay before we will responed to some message


messageSendDelayConst

public int messageSendDelayConst
Delay before we will send new message if no response was sent to us


proposalIgnoreTimeConst

public int proposalIgnoreTimeConst
If player haven't responded to our proposal in specified time, we will count it as ignored


walkDurationTimeConst

public int walkDurationTimeConst
How long the walk with other agent will last


waitDurationConst

public int waitDurationConst
this is default duration const, the timer will be set to this value + random from 0 to this value / 4. after this time, the agent will stop waiting TODO: feeling affects waitDuration?


waitAtHomeDurationConst

public int waitAtHomeDurationConst
This is default duration const, the timer will be set to this value + random from 0 to this value / 4. after this time, the agent will stop waiting


checkAgentBackDelayTimeConst

public int checkAgentBackDelayTimeConst
We will start checking if agent is back after this time


initWaitDurationConst

public int initWaitDurationConst
For this time we won't check if the agent is back, so he has chance to leave


generateWaitEventDurationConst

public int generateWaitEventDurationConst
We will generate wait emotional event every this value seconds


followAgentDistanceConst

public int followAgentDistanceConst
We will keep this distance between agent and us when we will follow him


communicationRangeConst

public int communicationRangeConst
How close the agent should for us to communicate with him or to allow to interrupter us.


AVOID_OBSTACLE_FUNCTION

private static final double AVOID_OBSTACLE_FUNCTION
OBSTACLE AVOIDANCE:

See Also:
Constant Field Values

AVOID_OBSTACLE_FUNCTION_MULTI

private static final double AVOID_OBSTACLE_FUNCTION_MULTI
See Also:
Constant Field Values

AVOID_OBSTACLE_MIN_DISTANCE

private static final double AVOID_OBSTACLE_MIN_DISTANCE
See Also:
Constant Field Values

AVOID_OBSTACLE_RUN_VECTOR_LENGTH

private static final double AVOID_OBSTACLE_RUN_VECTOR_LENGTH
See Also:
Constant Field Values

myMapListObtainedListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myMapListObtainedListener
Here we will listen to map event and store all nav points in our internals


mySlfListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldObjectEventListener mySlfListener
Listener to SLF message containing information about our agent.


myPlrListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldObjectEventListener myPlrListener
Listener to PLR message - information about agents we see.


myPlayerKilledListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myPlayerKilledListener
Listener to Kill Message - should not be used in scenario right now


myPathListener

public cz.cuni.amis.pogamut.base.agent.navigation.PathPlannerListener myPathListener
Path listener


myBotDiedListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myBotDiedListener
Listener to Die Message


myPlayerDamagedListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myPlayerDamagedListener
Listener to Hit Message


myBotDamagedListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myBotDamagedListener
Listener to Dam Message


myPickupListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myPickupListener
Listener to IPK Message


myGotInvListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myGotInvListener
Listener to GOT Message


myTextMessageListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myTextMessageListener
Listener to global chat message - text messages


myEndListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myEndListener
Listens to End Message


myBegListener

public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myBegListener
Listener to Beg Message

Constructor Detail

EmotionalBot

public EmotionalBot(cz.cuni.amis.pogamut.base.utils.logging.AgentLogger logger,
                    cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView worldView,
                    cz.cuni.amis.pogamut.base.communication.commands.ICommandSerializer commandSerializer)
Constructor for our agent.

Parameters:
logger - agent logger we use
worldView - worlview that provides us with information about environment
commandSerializer - serializer that allows us to send command to the environment
Method Detail

isOppositeSex

public boolean isOppositeSex(int id)
Here we check if the agent specified by id is opposite sex then our agent TODO: Unfinished

Parameters:
id - Id of the agent we are checking.
Returns:
true or false

isOppositeSex

public boolean isOppositeSex(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
Here we check if the agent specified by id is opposite sex then our agent TODO: Unfinished

Parameters:
agent - the agent we are checking
Returns:
true or false

isFemale

public boolean isFemale(int id)
Here we check if the agent specified by id is female. We may ask also about us.

Parameters:
id - Id of the agent we are checking.
Returns:
true if agent is female

isMale

public boolean isMale(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
Here we check if the agent is male. By default if the agent is human, he will be considered as male

Parameters:
agent - the agent we are checking.
Returns:
true if agent is male

isHuman

public boolean isHuman(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
Returns true if input agent is human being and not animal (also comupter controlled agents are human).

Parameters:
agent - input agent check
Returns:
whether input agent is a human

isHuman

public boolean isHuman(int id)
Returns true if input id belongs to human being and not animal (also comupter controlled agents are human).

Parameters:
id - input id to check
Returns:
whether input id belongs to a human

logEmotionEvent

public void logEmotionEvent(de.affect.xml.AffectInputDocument.AffectInput ai,
                            EventId event)
Logs emotion event.

Parameters:
ai - affect input
event - event id

prePrepareBot

protected void prePrepareBot()
Called after the bot is set up in the platform, but BEFORE he has body in the environment or before any message from the environment arrives. Is used to set up all objects/tools our agent will use. Here we will register all listeners, create emotion model and other helper classes.

Specified by:
prePrepareBot in class cz.cuni.amis.pogamut.ut2004.bot.AbstractUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>

postPrepareBot

protected void postPrepareBot(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo info)
Called after the bot has body in the environment.

Specified by:
postPrepareBot in class cz.cuni.amis.pogamut.ut2004.bot.AbstractUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>
Parameters:
info - contains information about current game - location we are in and so.

createInitializeCommand

protected cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Initialize createInitializeCommand()
Here we can set up our bot - his name and so. Should not be called here.

Specified by:
createInitializeCommand in class cz.cuni.amis.pogamut.ut2004.bot.AbstractUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>
Returns:

botInitialized

protected void botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange config,
                              cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init)
Called after the bot body is initialized in the environment.

Specified by:
botInitialized in class cz.cuni.amis.pogamut.ut2004.bot.AbstractUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>
Parameters:
config -
init -

doLogic

protected void doLogic()
                throws cz.cuni.amis.pogamut.base.exceptions.PogamutException
Main method for our bot reasoning. Should NOT be called here.

Specified by:
doLogic in class cz.cuni.amis.pogamut.ut2004.bot.SyncUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>
Throws:
cz.cuni.amis.pogamut.base.exceptions.PogamutException

botKilled

protected void botKilled(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotKilled event)
Called each time our agent die in the environment. Usefull for restarting state variables.

Specified by:
botKilled in class cz.cuni.amis.pogamut.ut2004.bot.ThreadedUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>
Parameters:
event -

actionKiss

protected void actionKiss(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We will kiss the agent.

Parameters:
agent -

actionGiveItem

protected void actionGiveItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player targetAgent,
                              ScenarioItemType item)
We will give target item to targetAgent if we have the item. Also we will update internals here. Will give item to agent instanly whereever he is - we have to check if the agents are in appropriate situation elsewhere.

Parameters:
targetAgent -
item -

actionSex

protected void actionSex(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We will have sex with the agent - should be made after SEX proposal was accepted.

Parameters:
agent -

actionSlap

protected void actionSlap(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We will slap the agent - should be used for humans.

Parameters:
agent -

actionCuddle

protected void actionCuddle(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We will cuddle the agent - should be used for animals.

Parameters:
agent -

actionCompliment

protected void actionCompliment(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We will compliment the agent - should be used for humans.

Parameters:
agent -

actionInsult

protected void actionInsult(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We will insult the agent - should be used for humans.

Parameters:
agent -

actionBye

protected void actionBye(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We will tell bye to the agent, that means we want to end contact with him for now.

Parameters:
agent -

actionMultipleBye

protected void actionMultipleBye(java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> values)
We will send bye to all the input agents (should be used just for agent interrupters).

Parameters:
values -

actionKick

protected void actionKick(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We will kick the agent - should be used for animals.

Parameters:
agent -

actionLeave

protected void actionLeave(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We will leave the agent (leave the state AGENT_WITH) - we are probably angry on the agent, so we leave him at last.

Parameters:
agent -

actionMakeProposal

protected void actionMakeProposal(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent,
                                  ProposalType type)
We will make input proposal to target agent.

Parameters:
agent -
type -

doAction

public void doAction(ActionType type,
                     cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
Does input action towards target agent.

Parameters:
type -
agent -

atCinema

public boolean atCinema()
Returns true if we are currently at cinema.

Returns:

atPark

public boolean atPark()
Returns true if we are currently at park.

Returns:

atHome

public boolean atHome(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
Returns true if we are currently at home of input agent.

Parameters:
agent -
Returns:

atMyHome

public boolean atMyHome()
Returns true if we are at our home location.

Returns:

parseItemType

public ScenarioItemType parseItemType(java.lang.String toString)
Parses item type from input string.

Parameters:
toString - input string we want to parse
Returns:
item type

clearNavigationVariables

public void clearNavigationVariables()
Clear path and recent location goals.


initScenario

public boolean initScenario(ScenarioType type,
                            java.lang.String agentName)
Sets the bot internals according to the intput scenario.

Parameters:
type - type of the scenario
agentName - desired agents name
Returns:

insertInterrupter

public void insertInterrupter(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
If our interrupter list does not contaion input agent we will check if he passes all conditions to be added to the interrupter agents list and add him eventually.

Parameters:
agent -

clearBotVariables

private void clearBotVariables()
Completely resets the bot state - called when bot killed. Emotions and feelings remain the same.


goToState

protected void goToState(StateType newState)
This method switches the bot to new state and notifies the bot - calls BeginState and EndState functions.

Parameters:
newState - state we are going to

endState

protected void endState(StateType endingState)
This method is called when some state ends.

Parameters:
endingState -

beginState

protected void beginState(StateType newState)
This method is called when we enter a new state.

Parameters:
newState -

forceFunction

private double forceFunction(double x,
                             double distance)
Used by obstacle avoidance code.

Parameters:
x -
distance -
Returns:

adjustLocations

private cz.cuni.amis.pogamut.base3d.worldview.objects.Location[] adjustLocations(cz.cuni.amis.pogamut.base3d.worldview.objects.Location[] moveLocation)
This will compute new Location to avoid hitting other players.

Parameters:
moveLocation -
Returns:

goToLocation

public boolean goToLocation(cz.cuni.amis.pogamut.base3d.worldview.objects.Location targetLocation)
Goes to target location. Keeps returning true while we are on our way there. If we are at location or some problem encountered, then returns false.

Parameters:
targetLocation -
Returns:

pickHighestFeelingPlayer

public cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pickHighestFeelingPlayer(java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> values)
Choose the player (human) with the biggest feeling toward. Should incorporate gender information? (TODO).

Parameters:
values -
Returns:

pickNewLocTarget

protected cz.cuni.amis.pogamut.base3d.worldview.objects.Location pickNewLocTarget()
Picks random location where we will head to.

Returns:

pickNewNavTarget

protected cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPoint pickNewNavTarget()
Rendomly picks some navigation point to head to.

Returns:

pickFocus

public cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pickFocus(java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> values)
Returns the player we should focus on now. Takes into account recent action, anger emotion and feeling. Does NOT take into account gender and wheter it is an animal.

Parameters:
values - input collection of players
Returns:
player with highest sum of emotion anger * 2, feeling and actionBonus

pickAction

protected ActionType pickAction(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
Picks some action toward the agent based on the feeligns toward the agent, current agent situation (atCinema, atHome), our agent current state (INTERRUPT..) and last action that the agent did to us.

Parameters:
agent - target agent
Returns:
the action we want to make

statePrepareScenario

protected void statePrepareScenario()
This initial state will set up scenario for us.


setAction

protected void setAction(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent,
                         ActionType type,
                         double time,
                         double duration)
Sets the action as current action and updates agent internals and player history.

Parameters:
agent -
type -
time -
duration -

showEmotions

public void showEmotions()
Process the bots current emotions and sets the emotion emitter accordingly.


shutdown

public void shutdown()
Method called when the agent will be shutdown -


parseProposalType

public ProposalType parseProposalType(java.lang.String text)
Parse proposal type from text.

Parameters:
text -
Returns:

getAgentHomeLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location getAgentHomeLocation(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
Returns home location for input agent, if don't know, boy home location will be used.

Parameters:
agent -
Returns:

getAgentHomePlace

public PlaceType getAgentHomePlace(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
Returns home place for input agent. If we don't know boy home place will be used.

Parameters:
agent -
Returns:

getPlayersHistory

public java.util.HashMap<java.lang.Integer,PlayerInfo> getPlayersHistory()
Getter for playersHistory.

Returns:
players history

getPlayerHistory

public PlayerInfo getPlayerHistory(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pl)
Returns PlayerInfo from playersHistory. If info does not exist, will be created.

Parameters:
pl -
Returns:

getPolymorphHistory

public PolymorphEventInfo getPolymorphHistory(int id)
Returns PolymorphInfo for input id. If does not exists, it will be created.

Parameters:
id - id of the polymorph
Returns:

getMyHomeLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location getMyHomeLocation()
Returns location of our home.

Returns:

getDestinationLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location getDestinationLocation(PlaceType goalPlace)
Returns actual location that we should head to if we want to reach input goal place! If we doesn't know the place we will go randomly somewhere

Parameters:
goalPlace -
Returns:

getState

public StateType getState()
Returns current agent state.

Returns:
current agent state

getPreviousState

public StateType getPreviousState()
Returns agents previous state.

Returns:
agents previous state

getMyName

public java.lang.String getMyName()
Returns agent name.

Returns:

getName

public java.lang.String getName(java.lang.String el)
Parses agent elicitor name.

Parameters:
el - input string (el for elicitor)
Returns:

timerProcess

public void timerProcess()
Called every do doLogic method (in listener to BEG message). Updates our timers (removes finished timers) and call timerFinished method if necessary.


timerGetTriggerTime

public double timerGetTriggerTime(TimerType timer)
Gets trigger time of input timer, if none returs -1.

Parameters:
timer -
Returns:

timerSet

public void timerSet(TimerType timer,
                     double timerDelay)
Sets the timer in our timer pool, timer starts running. If the timer of that type is already there, it will be reset.

Parameters:
timer -
timerDelay -

timerIsRunning

public boolean timerIsRunning(TimerType timer)
Returns true if the timer is active and running.

Parameters:
timer -
Returns:

timerErase

public void timerErase(TimerType timer)
Immediately removes target timer from timers pool. No timerFinished method will be called.

Parameters:
timer -

timersGetRunning

public java.util.ArrayList<TimerType> timersGetRunning()
Returns all currently running timers.

Returns:

timerFinished

public void timerFinished(TimerType timer)
Called anytime some timer is finished - it is not 100% accurate. Timers are checked everytime doLogic method is executed, which is 4 - 5 times per second.

Parameters:
timer -

getConversationHistory

public ConversationInfo getConversationHistory(int id)
Returns conversation history between me and target agent (logs messages sent by the agent to us). Create new if none found.

Parameters:
id -
Returns:

getOtherConversationHistory

public ConversationInfo getOtherConversationHistory(int id)
Returns conversation history for other agent (messages that were sent to him by other agents than we are).

Parameters:
id -
Returns:

conversate

protected void conversate(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player plr,
                          ConversationType type)
Basic conversation method.

Parameters:
plr -
type -

checkEmotionsIfWantProposal

protected boolean checkEmotionsIfWantProposal(int plrId,
                                              ProposalType type)
Here we check emotions and feelings towards agent. Return true if we want to accept input proposal from the agent.

Parameters:
plrId - agent that is proposing
type - type of the proposal
Returns:
true if we want the proposal

processMyProposal

protected boolean processMyProposal()
Here we will check the status of our proposals and set the internal variables and state according to it or even perform actions.

Returns:
if the proposal triggered something, we will return true

respondToProposal

protected boolean respondToProposal()
Responds to proposal we've received from other agent and change our internal state accordingly!

Returns:
true if we have responded to proposal

removeInterrupter

protected void removeInterrupter(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
Removes from agentInterrupters input agent, if he is there. Updates player history with information about agent last interrupt.

Parameters:
agent -

removeAllInterrupters

protected void removeAllInterrupters()
Removes all from agentInterrupters. Updates player history with information about agent last interrupt.


getNearestNavLocation

protected cz.cuni.amis.pogamut.base3d.worldview.objects.Location getNearestNavLocation(cz.cuni.amis.pogamut.base3d.worldview.objects.Location targetLocation)
Returns nearest navigation point to input location in the map.

Parameters:
targetLocation -
Returns:

getName

public java.lang.String getName(int id)
Gets agents name from id (if possible).

Parameters:
id - input int id of the agent
Returns:

logAction

private void logAction(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent,
                       ActionType type,
                       double time,
                       double duration)
Logs input action towards input agent into log file.

Parameters:
agent -
type -
time -
duration -

logItemGiven

private void logItemGiven(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent,
                          ScenarioItemType item,
                          double time)
Logs item given to some agent.

Parameters:
agent - target agent
item - item type
currentTime - time

logItemReceived

public void logItemReceived(int agentId,
                            java.lang.String agentName,
                            ScenarioItemType item,
                            double time)
Logs item received from some agent.

Parameters:
agentId -
agentName -
item - item type
time -

logProposal

private void logProposal(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent,
                         ProposalInfo newProp)
Logs input proposal toward input agent to log file.

Parameters:
agent - target agent
newProp - the proposal sent

logStateEntered

protected void logStateEntered(StateType state,
                               double time)
Logs state entered.

Parameters:
state -
time -

logStateLeft

protected void logStateLeft(StateType state,
                            double time)
Logs state left.

Parameters:
state -
time -

logAgentState

protected void logAgentState()
Logs current emotions and feelings + agent state.


throwExcp

public void throwExcp()
This is a bad hack that allows us to run more experiments in a row in really easy way.