bot
Class EmotionalFemaleBot

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
                                  extended by bot.EmotionalFemaleBot
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.agent.IAgent, cz.cuni.amis.pogamut.base.utils.IControllable

public class EmotionalFemaleBot
extends EmotionalBot

Main class for female emotional bot. Emotional bot is a finite state machine. The state code is triggered by doLogic() method. This method is invoked each time synchronous batch from GameBots arrive (default each 250 ms).


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
 
Fields inherited from class bot.EmotionalBot
agentInfo, agentInterrupters, agentLog, agentWith, agentWithDissapearTimeConst, approachFeelingConst, argumentLeaveFeelingThresholdConst, bLogEnabled, botMoving, boyHomeLocation, cinemaDelayTimeConst, cinemaFeelingConst, cinemaLocation, cinemaRejectFeelingConst, communicationRangeConst, complimentFeelingConst, complimentJoyConst, cuddleFeelingConst, cuddleTimeConst, currentTime, feelingsDecayCounter, firstGirlHomeLocation, flowerDelayTimeConst, flowerFeelingConst, followAgentDistanceConst, game, generatedEvents, generateWaitEventDurationConst, homeDelayTimeConst, homeFeelingConst, homeRejectFeelingConst, humanInterruptedDelayConst, checkAgentBackDelayTimeConst, ignoreFeelingConst, initAgentWithName, initWaitDurationConst, insultAngerConst, insultFeelingConst, interruptDelayConst, interruptDurationConst, kickEmoFeelingConst, kissDelayTimeConst, kissFeelingConst, knownNavPoints, lastActionDuration, lastActionTime, lastActionType, lastFollowPathLocation, lastWaitEventTime, leaveFeelingConst, loveFeelingConst, meetingCinemaLocation, messageFadeOutConst, messageResponseDelayConst, messageSendDelayConst, minimalActionDelayConst, minimalActionResponseDelayConst, myAEGenerator, myALMA, myBegListener, myBotDamagedListener, myBotDiedListener, myClassName, myConversationHistory, myEGenerator, myEmotionState, myEndListener, myGoalPlace, myGoalTarget, myGotInvListener, myItemRequests, myItems, myLocTarget, myMapListObtainedListener, myName, myPath, myPathListener, myPathPlanner, myPickupListener, myPlayerDamagedListener, myPlayerKilledListener, myPlrListener, myPlrTarget, mySkin, mySlfListener, myTextMessageListener, nearestNavLocation, otherConversationHistory, parkDelayTimeConst, parkFeelingConst, parkLocation, parkRejectFeelingConst, pathReceived, pathRequested, pathRequestedTime, pathRerequestDelay, players, playersHistory, playersIgnored, polymorphHistory, polymorphInterruptedDelayConst, previousState, proposalIgnoreTimeConst, proposalsHistory, randomLocationTargets, reapproachDelayConst, recentActionTimeConst, recentProposal, recentReceivedProposal, scenario, secondGirlHomeLocation, sexDelayTimeConst, sexFeelingConst, slapAngerConst, slapFeelingConst, startLocation, startRotation, state, stayWithAgentBonusFeelingConst, timersDelayTime, timersTriggerTime, waitAtHomeDurationConst, waitDurationConst, waitFeelingConst, waitForAgent, waitRejectFeelingConst, walkDurationTimeConst
 
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
EmotionalFemaleBot(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)
           
 
Method Summary
 void beginState(StateType newState)
          Called when we entered some state.
protected  cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Initialize createInitializeCommand()
          Here we can set up our bot - his name and so.
protected  void doLogic()
          Main method for our bot reasoning.
 void endState(StateType endingState)
          Called when we are leaving some state.
private  ProposalType pickProposal(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          This method checks if it is right time to make some proposal.
private  cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pickTargetPlayer(java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> values)
          Choose the player with the biggest feeling toward above 0 and opposite sex.
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.
private  void stateAgentAlone()
          This state handles a situation when the agent is alone in the environment.
private  void stateApproachBoys()
          Explore state for our girl.
private  void stateFollowAgentWith()
          We are following agentWith and going to cinema/park or our home.
private  void stateInterrupted()
          Here we handle interrupters.
private  void statePolymorphThreat()
          Not yet used.
private  void stateWait()
          Our waiting state.
private  void stateWithSomebody()
          Main state for handling iteraction with agentWith.
 void timerFinished(TimerType type)
          Called anytime some timer is finished - it is not 100% accurate.
 
Methods inherited from class bot.EmotionalBot
actionBye, actionCompliment, actionCuddle, actionGiveItem, actionInsult, actionKick, actionKiss, actionLeave, actionMakeProposal, actionMultipleBye, actionSex, actionSlap, atCinema, atHome, atMyHome, atPark, botInitialized, botKilled, clearNavigationVariables, conversate, doAction, getAgentHomeLocation, getAgentHomePlace, getConversationHistory, getDestinationLocation, getMyHomeLocation, getMyName, getName, getName, getNearestNavLocation, getOtherConversationHistory, getPlayerHistory, getPlayersHistory, getPolymorphHistory, getPreviousState, getState, goToLocation, goToState, checkEmotionsIfWantProposal, initScenario, insertInterrupter, isFemale, isHuman, isHuman, isMale, isOppositeSex, isOppositeSex, logAgentState, logEmotionEvent, logItemReceived, logStateEntered, logStateLeft, parseItemType, parseProposalType, pickAction, pickFocus, pickHighestFeelingPlayer, pickNewLocTarget, pickNewNavTarget, postPrepareBot, processMyProposal, removeAllInterrupters, removeInterrupter, respondToProposal, setAction, showEmotions, shutdown, statePrepareScenario, throwExcp, timerErase, timerGetTriggerTime, timerIsRunning, timerProcess, timerSet, timersGetRunning
 
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
 

Constructor Detail

EmotionalFemaleBot

public EmotionalFemaleBot(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)
Method Detail

prePrepareBot

protected void prePrepareBot()
Description copied from class: EmotionalBot
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.

Overrides:
prePrepareBot in class EmotionalBot

createInitializeCommand

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

Overrides:
createInitializeCommand in class EmotionalBot

doLogic

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

Overrides:
doLogic in class EmotionalBot
Throws:
cz.cuni.amis.pogamut.base.exceptions.PogamutException

pickProposal

private ProposalType pickProposal(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
This method checks if it is right time to make some proposal. If the time is right and we have required feelings to input agent this method returns suggested proposal we should make.

Parameters:
agent -
Returns:

pickTargetPlayer

private cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pickTargetPlayer(java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> values)
Choose the player with the biggest feeling toward above 0 and opposite sex.

Parameters:
values -
Returns:

stateAgentAlone

private void stateAgentAlone()
This state handles a situation when the agent is alone in the environment. The girl simply goes to her home, when in this state, where she waits until the timer expires and switch to another state. The interrupter check is done here (if the agent is interrupted, the state will be switched to interrupted state)


timerFinished

public void timerFinished(TimerType type)
Description copied from class: EmotionalBot
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.

Overrides:
timerFinished in class EmotionalBot

stateFollowAgentWith

private void stateFollowAgentWith()
We are following agentWith and going to cinema/park or our home.


stateInterrupted

private void stateInterrupted()
Here we handle interrupters. First we check our agentWith, than we pick the focus among interrupters. After that we can perform actions or conversation. We also respond to proposals here.


statePolymorphThreat

private void statePolymorphThreat()
Not yet used.


stateWait

private void stateWait()
Our waiting state. We wait for our agentWith, when we are in this state.


stateWithSomebody

private void stateWithSomebody()
Main state for handling iteraction with agentWith. Here we respond to proposals, make our own and trigger actions toward agentWith when we are alon with him.


stateApproachBoys

private void stateApproachBoys()
Explore state for our girl. Girl will explore environment and approach any boys she likes.


beginState

public void beginState(StateType newState)
Called when we entered some state.

Overrides:
beginState in class EmotionalBot
Parameters:
newState - new state

endState

public void endState(StateType endingState)
Called when we are leaving some state.

Overrides:
endState in class EmotionalBot
Parameters:
endingState - state we are leaving