|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcz.cuni.amis.pogamut.base.agent.AbstractAgent
cz.cuni.amis.pogamut.base.agent.AbstractObservingAgent<WORLD_VIEW>
cz.cuni.amis.pogamut.base.agent.AbstractGhostAgent<WORLD_VIEW>
cz.cuni.amis.pogamut.base.agent.AbstractEmbodiedAgent<WORLD_VIEW>
cz.cuni.amis.pogamut.ut2004.bot.AbstractUT2004Bot<WorldView>
cz.cuni.amis.pogamut.ut2004.bot.ThreadedUT2004Bot<WorldView>
cz.cuni.amis.pogamut.ut2004.bot.SyncUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>
bot.EmotionalBot
public class EmotionalBot
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 |
|---|
protected java.lang.String myName
public java.lang.String mySkin
public java.lang.String myClassName
public PogamutALMA myALMA
public AEventGenerator myAEGenerator
public EventGenerator myEGenerator
public AEmotionState myEmotionState
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location cinemaLocation
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location meetingCinemaLocation
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location boyHomeLocation
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location firstGirlHomeLocation
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location secondGirlHomeLocation
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location parkLocation
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location startLocation
public cz.cuni.amis.pogamut.base3d.worldview.objects.Rotation startRotation
public java.util.ArrayList<cz.cuni.amis.pogamut.base3d.worldview.objects.ILocated> myPath
public boolean pathRequested
public boolean pathReceived
public double pathRequestedTime
public int pathRerequestDelay
public java.util.HashMap<cz.cuni.amis.pogamut.ut2004.communication.messages.UnrealId,cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPoint> knownNavPoints
public java.util.ArrayList<cz.cuni.amis.pogamut.base3d.worldview.objects.Location> randomLocationTargets
public cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agentWith
public java.lang.String initAgentWithName
public cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player waitForAgent
public java.util.ArrayList<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> agentInterrupters
public cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player myPlrTarget
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location myLocTarget
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location myGoalTarget
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location nearestNavLocation
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location lastFollowPathLocation
public ScenarioType scenario
public PlaceType myGoalPlace
public boolean botMoving
public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game game
public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo agentInfo
public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Players players
public cz.cuni.amis.pogamut.ut2004.agent.navigation.UTAstar myPathPlanner
protected double lastActionTime
protected double lastActionDuration
protected ActionType lastActionType
public java.util.HashMap<java.lang.Integer,java.util.ArrayList<ProposalInfo>> proposalsHistory
public ProposalInfo recentProposal
public ProposalInfo recentReceivedProposal
public java.util.HashMap<java.lang.Integer,PlayerInfo> playersHistory
public java.util.HashMap<ScenarioItemType,java.lang.Integer> myItems
public java.util.ArrayList<ItemRequest> myItemRequests
public boolean bLogEnabled
public AgentLogging agentLog
public java.util.HashMap<TimerType,java.lang.Double> timersTriggerTime
public java.util.HashMap<TimerType,java.lang.Double> timersDelayTime
public java.util.HashMap<EventId,java.lang.Boolean> generatedEvents
public java.util.HashMap<java.lang.Integer,cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> playersIgnored
public java.util.HashMap<java.lang.Integer,PolymorphEventInfo> polymorphHistory
public java.util.HashMap<java.lang.Integer,ConversationInfo> myConversationHistory
public java.util.HashMap<java.lang.Integer,ConversationInfo> otherConversationHistory
protected StateType state
protected StateType previousState
public double currentTime
protected int feelingsDecayCounter
protected double lastWaitEventTime
public double loveFeelingConst
public double kissFeelingConst
public double cinemaFeelingConst
public double parkFeelingConst
public double homeFeelingConst
public double cinemaRejectFeelingConst
public double parkRejectFeelingConst
public double homeRejectFeelingConst
public double slapFeelingConst
public double leaveFeelingConst
public double cuddleFeelingConst
public double argumentLeaveFeelingThresholdConst
public double ignoreFeelingConst
public double kickEmoFeelingConst
public double flowerFeelingConst
public double complimentFeelingConst
public double insultFeelingConst
public double sexFeelingConst
public double approachFeelingConst
public double slapAngerConst
public double insultAngerConst
public double complimentJoyConst
public double stayWithAgentBonusFeelingConst
public double waitFeelingConst
public double waitRejectFeelingConst
public double cuddleTimeConst
public double flowerDelayTimeConst
public double cinemaDelayTimeConst
public double parkDelayTimeConst
public int homeDelayTimeConst
public double reapproachDelayConst
public double minimalActionDelayConst
public double minimalActionResponseDelayConst
public double messageFadeOutConst
public double sexDelayTimeConst
public double kissDelayTimeConst
public double recentActionTimeConst
public double interruptDelayConst
public double agentWithDissapearTimeConst
public int interruptDurationConst
public int humanInterruptedDelayConst
public int polymorphInterruptedDelayConst
public int messageResponseDelayConst
public int messageSendDelayConst
public int proposalIgnoreTimeConst
public int walkDurationTimeConst
public int waitDurationConst
public int waitAtHomeDurationConst
public int checkAgentBackDelayTimeConst
public int initWaitDurationConst
public int generateWaitEventDurationConst
public int followAgentDistanceConst
public int communicationRangeConst
private static final double AVOID_OBSTACLE_FUNCTION
private static final double AVOID_OBSTACLE_FUNCTION_MULTI
private static final double AVOID_OBSTACLE_MIN_DISTANCE
private static final double AVOID_OBSTACLE_RUN_VECTOR_LENGTH
public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myMapListObtainedListener
public cz.cuni.amis.pogamut.base.agent.worldview.WorldObjectEventListener mySlfListener
public cz.cuni.amis.pogamut.base.agent.worldview.WorldObjectEventListener myPlrListener
public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myPlayerKilledListener
public cz.cuni.amis.pogamut.base.agent.navigation.PathPlannerListener myPathListener
public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myBotDiedListener
public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myPlayerDamagedListener
public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myBotDamagedListener
public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myPickupListener
public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myGotInvListener
public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myTextMessageListener
public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myEndListener
public cz.cuni.amis.pogamut.base.agent.worldview.WorldEventListener myBegListener
| Constructor Detail |
|---|
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)
logger - agent logger we useworldView - worlview that provides us with information about environmentcommandSerializer - serializer that allows us to send command to the environment| Method Detail |
|---|
public boolean isOppositeSex(int id)
id - Id of the agent we are checking.
public boolean isOppositeSex(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - the agent we are checking
public boolean isFemale(int id)
id - Id of the agent we are checking.
public boolean isMale(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - the agent we are checking.
public boolean isHuman(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - input agent check
public boolean isHuman(int id)
id - input id to check
public void logEmotionEvent(de.affect.xml.AffectInputDocument.AffectInput ai,
EventId event)
ai - affect inputevent - event idprotected void prePrepareBot()
prePrepareBot in class cz.cuni.amis.pogamut.ut2004.bot.AbstractUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>protected void postPrepareBot(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo info)
postPrepareBot in class cz.cuni.amis.pogamut.ut2004.bot.AbstractUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>info - contains information about current game - location we are in and so.protected cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Initialize createInitializeCommand()
createInitializeCommand in class cz.cuni.amis.pogamut.ut2004.bot.AbstractUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>
protected void botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange config,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init)
botInitialized in class cz.cuni.amis.pogamut.ut2004.bot.AbstractUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>config - init -
protected void doLogic()
throws cz.cuni.amis.pogamut.base.exceptions.PogamutException
doLogic in class cz.cuni.amis.pogamut.ut2004.bot.SyncUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>cz.cuni.amis.pogamut.base.exceptions.PogamutExceptionprotected void botKilled(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotKilled event)
botKilled in class cz.cuni.amis.pogamut.ut2004.bot.ThreadedUT2004Bot<cz.cuni.amis.pogamut.ut2004.agent.worldview.UT2004SyncLockableWorldView>event - protected void actionKiss(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent -
protected void actionGiveItem(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player targetAgent,
ScenarioItemType item)
targetAgent - item - protected void actionSex(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - protected void actionSlap(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - protected void actionCuddle(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - protected void actionCompliment(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - protected void actionInsult(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - protected void actionBye(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - protected void actionMultipleBye(java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> values)
values - protected void actionKick(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - protected void actionLeave(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent -
protected void actionMakeProposal(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent,
ProposalType type)
agent - type -
public void doAction(ActionType type,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
type - agent - public boolean atCinema()
public boolean atPark()
public boolean atHome(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent -
public boolean atMyHome()
public ScenarioItemType parseItemType(java.lang.String toString)
toString - input string we want to parse
public void clearNavigationVariables()
public boolean initScenario(ScenarioType type,
java.lang.String agentName)
type - type of the scenarioagentName - desired agents name
public void insertInterrupter(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - private void clearBotVariables()
protected void goToState(StateType newState)
newState - state we are going toprotected void endState(StateType endingState)
endingState - protected void beginState(StateType newState)
newState -
private double forceFunction(double x,
double distance)
x - distance -
private cz.cuni.amis.pogamut.base3d.worldview.objects.Location[] adjustLocations(cz.cuni.amis.pogamut.base3d.worldview.objects.Location[] moveLocation)
moveLocation -
public boolean goToLocation(cz.cuni.amis.pogamut.base3d.worldview.objects.Location targetLocation)
targetLocation -
public cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pickHighestFeelingPlayer(java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> values)
values -
protected cz.cuni.amis.pogamut.base3d.worldview.objects.Location pickNewLocTarget()
protected cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPoint pickNewNavTarget()
public cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pickFocus(java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> values)
values - input collection of players
protected ActionType pickAction(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - target agent
protected void statePrepareScenario()
protected void setAction(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent,
ActionType type,
double time,
double duration)
agent - type - time - duration - public void showEmotions()
public void shutdown()
public ProposalType parseProposalType(java.lang.String text)
text -
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location getAgentHomeLocation(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent -
public PlaceType getAgentHomePlace(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent -
public java.util.HashMap<java.lang.Integer,PlayerInfo> getPlayersHistory()
public PlayerInfo getPlayerHistory(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pl)
pl -
public PolymorphEventInfo getPolymorphHistory(int id)
id - id of the polymorph
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location getMyHomeLocation()
public cz.cuni.amis.pogamut.base3d.worldview.objects.Location getDestinationLocation(PlaceType goalPlace)
goalPlace -
public StateType getState()
public StateType getPreviousState()
public java.lang.String getMyName()
public java.lang.String getName(java.lang.String el)
el - input string (el for elicitor)
public void timerProcess()
public double timerGetTriggerTime(TimerType timer)
timer -
public void timerSet(TimerType timer,
double timerDelay)
timer - timerDelay - public boolean timerIsRunning(TimerType timer)
timer -
public void timerErase(TimerType timer)
timer - public java.util.ArrayList<TimerType> timersGetRunning()
public void timerFinished(TimerType timer)
timer - public ConversationInfo getConversationHistory(int id)
id -
public ConversationInfo getOtherConversationHistory(int id)
id -
protected void conversate(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player plr,
ConversationType type)
plr - type -
protected boolean checkEmotionsIfWantProposal(int plrId,
ProposalType type)
plrId - agent that is proposingtype - type of the proposal
protected boolean processMyProposal()
protected boolean respondToProposal()
protected void removeInterrupter(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - protected void removeAllInterrupters()
protected cz.cuni.amis.pogamut.base3d.worldview.objects.Location getNearestNavLocation(cz.cuni.amis.pogamut.base3d.worldview.objects.Location targetLocation)
targetLocation -
public java.lang.String getName(int id)
id - input int id of the agent
private void logAction(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent,
ActionType type,
double time,
double duration)
agent - type - time - duration -
private void logItemGiven(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent,
ScenarioItemType item,
double time)
agent - target agentitem - item typecurrentTime - time
public void logItemReceived(int agentId,
java.lang.String agentName,
ScenarioItemType item,
double time)
agentId - agentName - item - item typetime -
private void logProposal(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent,
ProposalInfo newProp)
agent - target agentnewProp - the proposal sent
protected void logStateEntered(StateType state,
double time)
state - time -
protected void logStateLeft(StateType state,
double time)
state - time - protected void logAgentState()
public void throwExcp()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||