bot
Class EmotionalMaleBot

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

public class EmotionalMaleBot
extends EmotionalBot

Main class for male 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
EmotionalMaleBot(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 this object.
 
Method Summary
 void beginState(StateType newState)
          Called when we entered a new 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 left ceratain state.
private  ScenarioItemType pickItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
          Picks item according to our feeling, item possesions and agent internals.
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.
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()
          State handling the situation when our agent is alone.
private  void stateFollowAgentWith()
          We are following agentWith and going to cinema/park or our home.
private  void stateGoingSomewhereWithSomebody()
          We are leading agentWith somewhere - cinema, park, her home...
private  void stateInterrupted()
          Here we handle the interrupters.
private  void statePolymorphThreat()
          Not used yet.
private  void stateWait()
           
private  void stateWithSomebody()
          Main state for handling the interaction with agentWith.
 
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, timerFinished, 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

EmotionalMaleBot

public EmotionalMaleBot(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 this object.

Parameters:
logger -
worldView -
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

pickItem

private ScenarioItemType pickItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
Picks item according to our feeling, item possesions and agent internals.

Parameters:
agent -
Returns:

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. Should incorporate gender information (TODO).

Parameters:
values -
Returns:

stateWait

private void stateWait()

stateAgentAlone

private void stateAgentAlone()
State handling the situation when our agent is alone. The boy will start to explore the environment trying to find some girls he likes. Also interrupters are handled here by switching to interrupted state.


stateFollowAgentWith

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


stateGoingSomewhereWithSomebody

private void stateGoingSomewhereWithSomebody()
We are leading agentWith somewhere - cinema, park, her home...


stateInterrupted

private void stateInterrupted()
Here we handle the interrupters. First we check our agentWith, than we pick focus among interrupters. After that we can perform some action or conversation. We can also respond to proposals here - the response may not match the agent we picked as our focus (we can respond to agent1 but our focus will be agent2).


statePolymorphThreat

private void statePolymorphThreat()
Not used yet.


stateWithSomebody

private void stateWithSomebody()
Main state for handling the interaction with agentWith. Here we will make proposals to her to go home, to kiss, to have sex...


beginState

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

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

endState

public void endState(StateType endingState)
Called when we left ceratain state.

Overrides:
endState in class EmotionalBot
Parameters:
endingState - state we have left