|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbot.EventGenerator
public class EventGenerator
In this class we will generate all the events our agent can encounter in the scenario. We will send here notifications to emotion model to generate emotional events and we will also update agent internal state. This class contains number of constants that affects the event generation. Methods with notify word in their name are called by listeners defined in EmotionalBot.java each time new event of certain type arrives. From notify methods we will call process method that will process the message and generate events and update agent internal state.
| Field Summary | |
|---|---|
private int |
actionLeaveDelayConst
Delay between two leave action events generated |
private cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player |
agentTalkingToAgentWith
last agent that talked to agent we accompany somewhere |
private cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player |
agentTalkingToUs
last agent that talked to us |
private double |
aloneEventDelayTimeConst
When we detect we are alone, we will generete alone event every this constant seconds |
private double |
conversationIgnoreDelayConst
Delay between two conversation ignore events |
private double |
conversationIgnoreTimeConst
If the delay between last response and last message sent to the player is higher then this ignore event will be generated |
int |
conversationIgnoreTogetherTimeConst
This is the time we need to be together with agentWith to generate ignoreEvent |
private double |
lastAloneEventTime
helper variable - time of last alone event |
private double |
lostEventsDelayTimeConst
Minimum time between two player lost events |
private double |
messageHistoryTimerConst
in communication info history we will delete messages older than currentTime - this |
private double |
messageIntensityReductionMultiplier
We will reduce the emotional intensity of messages by this number, 2 default |
private double |
messageReductionCountConst
This means that when we are sent this number per messageHistoryTimerConst, we will reduce emotion intensity significantly! |
private EmotionalBot |
myAgent
Pointer to our agent |
private double |
polymorphEventHistoryTimerConst
How long we will remember polymorph triggered events |
private double |
polymorphEventReductionCountConst
This means that when we encountered this number of events per polymorphEventHistoryTimerConst, we will reduce emotion intensity significantly! |
private double |
reappearEventTriggerTimeConst
We will generate new appear event when we haven't seen player for this const seconds |
private double |
sightLostConst
After this const seconds when we haven't seen pawn, we will count it as lost sight and stop updating timeTogetherCounter |
private double |
sightLostEventTriggerTimeConst
If we haven't seen player for this time, we will generate player lost event if also other conditions met |
private double |
togetherEventTriggerTimeConst
We will generate together event every this const seconds |
| Constructor Summary | |
|---|---|
EventGenerator(EmotionalBot myAgent)
Only constructor for this class. |
|
| Method Summary | |
|---|---|
private boolean |
detectAgentSpeakingInterruptions()
Here we detect other agents interruptions. |
private void |
checkRepeatingEvents()
Check agent ignore and proposal ignore events and generate them if necessary. |
void |
notifyBegin(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BeginMessage beg)
New begin message received. |
void |
notifyBotDamaged(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotDamaged bd)
New bot damaged message received (DAM message). |
void |
notifyGotInv(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ReceivedInventoryMsg rIM)
New received inventory message received. |
void |
notifyPickup(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ItemPickedUp ipk)
New item picked up message received. |
void |
notifyPlayer(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player plr)
New player message received. |
void |
notifyPlayerDamaged(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerDamaged pldam)
New player damage message received (HIT message). |
void |
notifyPlayerKilled(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerKilled pk)
New player killed message received (KIL message). |
void |
notifyTextMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
New global chat message received. |
private void |
processActionToMe(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat gc)
Some agent did action to me. |
private void |
processActionToOther(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat gc)
Some agent did some action to other agent. |
private void |
processDamMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotDamaged bd)
Process DAM message and generate appropriate emotion event. |
private void |
processGotInvMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ReceivedInventoryMsg rim)
Process received inventory message (GOT), generates emotional event and store information into agents internals. |
private void |
processHitMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerDamaged pd)
Process HIT message and generate appropriate emotion event. |
private void |
processItemRequestToMe(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
Process the message and store the corresponding item request to agent internals. |
private void |
processKillMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerKilled pk)
Player killed message. |
private void |
processOtherTextMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
Process text message sent by someone to other agent. |
private void |
processPickup(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ItemPickedUp ipk)
Process pickup messages. |
private void |
processPlayer(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pl)
Before the playersHistory is updated this allows us to generate appeared events. |
private void |
processPlayerHistory()
Here we will generate events - PlayerDissapearedEvent and PlayerTogetherEvent |
private void |
processPolymorphTextMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
Generate fear and disliking or liking depending on the noise the polymorph is making. |
private void |
processProposalToMe(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
Here we process proposal sent to our agent. |
private void |
processProposalToOther(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
Some proposal or proposal answer was sent to some other agent. |
private void |
processTextMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
Here we will determine what kind of a situation this text message corresponds to and call appropriate methods that will process the message further. |
private void |
processTextMessageToMe(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
Here we will process text message adressed to our agent. |
void |
updatePlayerHistory(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pl)
Called each time we receive some PLR message (from listener). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private EmotionalBot myAgent
private cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agentTalkingToUs
private cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agentTalkingToAgentWith
private double lastAloneEventTime
private double messageHistoryTimerConst
private double messageReductionCountConst
private double messageIntensityReductionMultiplier
private double polymorphEventHistoryTimerConst
private double polymorphEventReductionCountConst
private double togetherEventTriggerTimeConst
private double sightLostEventTriggerTimeConst
private double reappearEventTriggerTimeConst
private double lostEventsDelayTimeConst
private double aloneEventDelayTimeConst
private double conversationIgnoreTimeConst
private double conversationIgnoreDelayConst
public int conversationIgnoreTogetherTimeConst
private int actionLeaveDelayConst
private double sightLostConst
| Constructor Detail |
|---|
public EventGenerator(EmotionalBot myAgent)
myAgent - agent we generate events for| Method Detail |
|---|
public void notifyBegin(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BeginMessage beg)
beg - new begin messagepublic void notifyGotInv(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ReceivedInventoryMsg rIM)
rIM - new received inventory messagepublic void notifyPickup(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ItemPickedUp ipk)
ipk - new item picked up messagepublic void notifyPlayer(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player plr)
plr - new player messagepublic void notifyTextMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
message - new global chat messagepublic void notifyPlayerDamaged(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerDamaged pldam)
pldam - new player damaged messagepublic void notifyPlayerKilled(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerKilled pk)
pk - new player killed messagepublic void notifyBotDamaged(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotDamaged bd)
bd - new bot damaged messageprivate boolean detectAgentSpeakingInterruptions()
private void processActionToMe(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat gc)
gc - message containing the action towards usprivate void processActionToOther(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat gc)
gc - message containing the action towards otherprivate void processItemRequestToMe(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
message - message containing the item requestprivate void processKillMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerKilled pk)
pk - player killed messageprivate void processPickup(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ItemPickedUp ipk)
ipk - private void processPlayerHistory()
private void processHitMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerDamaged pd)
pd - input HIT messageprivate void processDamMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotDamaged bd)
bd - input DAM messageprivate void processGotInvMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ReceivedInventoryMsg rim)
rim - input received inventory messageprivate void processPlayer(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pl)
pl - other agentprivate void processProposalToMe(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
message - contains the message with proposal to processprivate void processProposalToOther(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
message - message containing the proposalprivate void processTextMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
message - input text messageprivate void processTextMessageToMe(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
message - input text messageprivate void processOtherTextMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
message - input text messageprivate void processPolymorphTextMessage(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
message - input text messageprivate void checkRepeatingEvents()
public void updatePlayerHistory(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pl)
pl -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||