|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalmabasedmodel.AEventGenerator
public class AEventGenerator
This class evaluates and generates emotional events for ALMA emotional model. When some event is catched by EventGenerator.java class appropriate method here is called to evaluate the event by OCC variables and send it to emotion model (PogamutALMA.java). One event can lead to more emotions (usually two). The emotions generated depend on the event properties and sometimes also on the feeling we have associated with the agents that caused or are affected by the event. The names of the methods here follow certain logic. If the keyword Action is present it means the event is result of some action. If the proposal keyword is present, it means that the event is associated with proposals somehow and etc. "By" keyword means that the cause of the action wasn't our agent (someone else has done the action). Keyword "Other" means that our agent wasn't involved at all in the event.
| Field Summary | |
|---|---|
PogamutALMA |
emModel
Class holding connection to ALMA emotion model |
EmotionalBot |
myAgent
Pointer to our agent we generate evets for |
AEmotionState |
myEmotionState
Class holding information about agents emotions and feelings got and computed from ALMA |
private int |
pickupEventId
This variable prevents some concurent write exceptions in ALMA model - cause of them yet unknown |
| Constructor Summary | |
|---|---|
AEventGenerator(PogamutALMA inputModel,
AEmotionState myEmState,
EmotionalBot myAgent)
Only constructor for this class. |
|
| Method Summary | |
|---|---|
void |
generateActionByeByEvent(int id)
Result of Action BYE. |
void |
generateActionByeOtherEvent(int id,
PlayerInfo agentLeft)
Result of Action BYE. |
void |
generateActionComplimentByEvent(int id)
Result of Action COMPLIMENT. |
void |
generateActionComplimentOtherEvent(int id,
PlayerInfo target)
Result of Action COMPLIMENT. |
void |
generateActionCuddleByEvent(int id)
|
void |
generateActionInsultByEvent(int id)
Result of Action INSULT. |
void |
generateActionInsultOtherEvent(int id,
PlayerInfo target)
Result of Action INSULT. |
void |
generateActionKickByEvent(int id)
Not implemented yet. |
void |
generateActionKickOtherEvent(int kickerId,
PlayerInfo target)
Result of Action KICK. |
void |
generateActionKissByEvent(int id)
Result of Action KISS. |
void |
generateActionKissEvent(int agentId)
Result of Action KISS – we have kissed the agent. |
void |
generateActionKissOtherEvent(int kisserId,
PlayerInfo target)
Result of Action KISS – someone has kissed other agent in the scenario (our agent wasn't involved). |
void |
generateActionLeaveByEvent(int id)
Result of Action LEAVE. |
void |
generateActionLeaveOtherEvent(int id,
PlayerInfo agentLeft)
Result of Action LEAVE. |
void |
generateActionSexByEvent(int id)
Result of Action SEX. |
void |
generateActionSexOtherEvent(int id,
PlayerInfo result)
Result of Action SEX. |
void |
generateActionSlapByEvent(int agentId)
Result of Action SLAP – we have been slapped by other agent. |
void |
generateActionSlapOtherEvent(int slapperId,
PlayerInfo target)
Result of Action SLAP. |
void |
generateAloneEvent()
Generated every x seconds when we are alone (agent doesn't see anyone). |
void |
generateAngerFearMessageEvent(int id,
int smiliesCount,
double reduction)
Someone has sent us message that contains anger and/or fear smilies. |
void |
generateConversationIgnoreByEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
This event is generated after some time we have spent together with other agent who is not responding to our conversation. |
void |
generateHappySadMessageEvent(int id,
int smiliesCount,
double reduction)
Someone has sent us message that contains joy and/or distress smilies. |
void |
generateInterruptedEvent(java.util.ArrayList<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> agentInterrupters)
We are with some other agent and we are doing something with him – speaking or going somewhere – and we are interrupted by other agent or agents – someone is speaking to us, polymorph approached us or else and we want to react to these other agents (we are not ignoring him, he is close enough and etc.). |
void |
generateItemJelausyEvent(ScenarioItemType itemType,
int id)
Some agent gave item to other agent. |
void |
generateLikeDislikeMessageEvent(int id,
int smiliesCount,
double reduction)
Someone has sent us message that contains like and/or dislike smilies. |
void |
generateMessageToOtherEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
int likeCount,
int dislikeCount,
double reduction)
Someone has send message to other agent that contains like and/or dislike smilies. |
void |
generatePickupEvent(ScenarioItemType type)
We have picked up some item – can be flower, condom or gun. |
void |
generatePlayerAppearedEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pl,
boolean firstTime)
This event is generated when we have spotted the agent for the first time or when we haven't seen the agent for some time and we see him again (emotions are lower in the second case). |
void |
generatePlayerKilledEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerKilled pk)
Shouldn't happen in the scenario. |
void |
generatePlayerLostEvent(int id)
Generated when we have lost sight of other agent (we have stopped seeing him and this state lasts for some time now). |
void |
generatePlayerTogetherEvent(int id)
Generated every x seconds we are together with other agent. |
void |
generatePolymorphActionBiteEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
The polymorph has bitten us! |
void |
generatePolymorphBiteEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotDamaged bd)
The polymorph has damaged us – caused our health to be lower. |
void |
generatePolymorphDislikeFearEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
double reduction)
We are close to hostile polymorph who is making bad noises. |
void |
generatePolymorphLikeEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
double reduction)
We have encountered friendly polymorph and he is making friendly noises toward us. |
void |
generateProposalByOtherToAgentWithEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType type)
Someone is making a proposal toward agent we are currently with! |
void |
generateProposalIgnoreEvent(int id)
Someone we have made proposal to is not responding to it (he ignored our proposal). |
void |
generateProposalOtherResponseEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType type,
boolean bAccepted)
Someone is responding to proposal to other agent (and none of them is currently with us). |
void |
generateProposalResponseEvent(boolean accepted,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
Someone has responded to our proposal. |
void |
generateProposalResponseToOtherByAgentWithEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType proposalType,
boolean bAccepted)
The agent we are currently with is responding to proposal made by other agent. |
void |
generateProposalToOtherByAgentWithEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType type)
The agent we are currently with is making proposal to other agent. |
void |
generateProposalToOtherEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType type)
Someone is making proposal to other agent (and none of them is currently with us). |
void |
generateReceivedItemEvent(ScenarioItemType itemType,
int id)
We have received item from someone. |
void |
generateReceivedProposalEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType type,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agentWith,
java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> agentInterrupters)
Someone has made proposal to us. |
void |
generateWaitAgentNotReturnedEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We were waiting for the agent and the agent didn't come to us in time. |
void |
generateWaitAgentReturnedEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We were waiting for the agent and the agent returned in time. |
void |
generateWaitInProgressEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
We are currently waiting on the agent. |
void |
generateWeHitPolymorphEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerDamaged pd)
We have hit the polymorph with the gun – we are proud on ourselves. |
double |
sigmoid(double x,
double normV,
double sharpness)
Calculates S-curve for point x in the interval 0 .. normV |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public PogamutALMA emModel
public AEmotionState myEmotionState
public EmotionalBot myAgent
private int pickupEventId
| Constructor Detail |
|---|
public AEventGenerator(PogamutALMA inputModel,
AEmotionState myEmState,
EmotionalBot myAgent)
inputModel - emotion model we are using (ALMA)myEmState - class that holds emotion and feeling informationmyAgent - the agent we are generating emotion events for| Method Detail |
|---|
public void generateActionKissEvent(int agentId)
agentId - agent we have kissed
public void generateActionKissOtherEvent(int kisserId,
PlayerInfo target)
kisserId - the agent who kissed someonetarget - the agent who was kissedpublic void generateActionSlapByEvent(int agentId)
agentId - the agent who slapped us
public void generateActionSlapOtherEvent(int slapperId,
PlayerInfo target)
slapperId - agent who slapped someonetarget - victim - agent that was slapped
public void generateActionKickOtherEvent(int kickerId,
PlayerInfo target)
kickerId - the agent who kicked someonetarget - victim - agent who was kicked (probably some animal)public void generateActionByeByEvent(int id)
id - agent that said bye to uspublic void generateActionComplimentByEvent(int id)
id - agent that said compliment to us
public void generateActionComplimentOtherEvent(int id,
PlayerInfo target)
id - the agent who said the complimenttarget - the target of the compliment (not us)public void generateActionCuddleByEvent(int id)
id - public void generateActionInsultByEvent(int id)
id - agent who said the insult to us
public void generateActionInsultOtherEvent(int id,
PlayerInfo target)
id - agent that said the insulttarget - victim - the agent the insult was forpublic void generateActionKickByEvent(int id)
id - public void generateActionSexByEvent(int id)
id - the agent we are making love to or vice versa
public void generateActionSexOtherEvent(int id,
PlayerInfo result)
id - agent that is making love to someoneresult - target of the love actpublic void generateActionKissByEvent(int id)
id - agent that has kissed uspublic void generateActionLeaveByEvent(int id)
id - agent that has left us
public void generateActionLeaveOtherEvent(int id,
PlayerInfo agentLeft)
id - the agent that left someoneagentLeft - the agent that was left by someone
public void generateActionByeOtherEvent(int id,
PlayerInfo agentLeft)
id - the agent that said bye to someoneagentLeft - the agent that was left (the bye was for this agent)public void generateConversationIgnoreByEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - agent that ignored uspublic void generateAloneEvent()
public void generatePickupEvent(ScenarioItemType type)
type - type of the item we have picked uppublic void generatePlayerLostEvent(int id)
id - the agent we have lost sight topublic void generatePlayerTogetherEvent(int id)
id - the agent we are together with
public void generatePlayerAppearedEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player pl,
boolean firstTime)
pl - agent that has appearedfirstTime - true if we see the agent for the first time
public void generateAngerFearMessageEvent(int id,
int smiliesCount,
double reduction)
id - agent who said the messagesmiliesCount - number of the smilies - positive means more anger smilies,
negative more fear smiliesreduction - number we will reduce the emotion instensity by
public void generateHappySadMessageEvent(int id,
int smiliesCount,
double reduction)
id - agent who said the messagesmiliesCount - number of the smilies - positive means more joy smilies,
negative more distress smiliesreduction - number we will reduce the emotion instensity bypublic void generateInterruptedEvent(java.util.ArrayList<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> agentInterrupters)
agentInterrupters - list of agents that are interrupting us
public void generateItemJelausyEvent(ScenarioItemType itemType,
int id)
itemType - type of the item that was given to someoneid - id of the agent who gave the item to someone (not us)
public void generateMessageToOtherEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
int likeCount,
int dislikeCount,
double reduction)
message - the message that was sent to some agentlikeCount - number of like smilies in the messagedislikeCount - number of dislike smilies in the messagereduction - number we will reduce the emotion intensity by
public void generateLikeDislikeMessageEvent(int id,
int smiliesCount,
double reduction)
id - agent who said the messagesmiliesCount - number of the smilies - positive means more like smilies,
negative more dislike smiliesreduction - number we will reduce the emotion instensity bypublic void generatePolymorphActionBiteEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
message - message containing the hostile polymorph message
public void generateProposalToOtherEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType type)
message - message containing the proposal of some other agent to someonetype - type of the proposal sent
public void generateProposalOtherResponseEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType type,
boolean bAccepted)
message - message containing the proposal responsetype - type of the proposalbAccepted - true if it was accepted, false otherwise
public void generateProposalResponseToOtherByAgentWithEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType proposalType,
boolean bAccepted)
message - message containing the proposal responseproposalType - type of the proposalbAccepted - true if the proposal was accepted, false otherwise
public void generateProposalToOtherByAgentWithEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType type)
message - message containing the proposal from agentWithtype - type of the proposal
public void generateProposalByOtherToAgentWithEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType type)
message - message containing the proposal for agentWithtype - type of the proposal
public void generateProposalResponseEvent(boolean accepted,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message)
accepted - true if the proposal was acceptedmessage - message containing the proposal responsepublic void generateProposalIgnoreEvent(int id)
id - agent that ignored our proposal
public void generatePolymorphDislikeFearEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
double reduction)
message - message containing the hostile polymorph messagereduction - we will reduce the emotion intensity by thispublic void generatePolymorphBiteEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotDamaged bd)
bd - message containing the information about who damaged us
public void generatePolymorphLikeEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
double reduction)
message - message containing the friendly polymoprh messagereduction - we will reduce the emotion intensity by this numberpublic void generateWaitAgentNotReturnedEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - agent that we were waiting forpublic void generateWaitAgentReturnedEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - agent we were waiting for and now has returnedpublic void generateWaitInProgressEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agent)
agent - agent we are waiting forpublic void generateWeHitPolymorphEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerDamaged pd)
pd - message containing the information about hit we have made
public void generateReceivedItemEvent(ScenarioItemType itemType,
int id)
itemType - type of the item we have receivedid - agent who gave us the item
public void generateReceivedProposalEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GlobalChat message,
ProposalType type,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player agentWith,
java.util.Collection<cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player> agentInterrupters)
message - message containing the proposal from other agenttype - type of the proposalagentWith - the agent who made the proposalagentInterrupters - list of all agent interrupters if the proposal is
proposal leave we will check if we want to leave the agents - if we like
them too much we will be unhappy that someone is asking us to leavepublic void generatePlayerKilledEvent(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerKilled pk)
pk - message containing the info about player killed
public double sigmoid(double x,
double normV,
double sharpness)
x - input coordinatenormV - scale value which corresponds to 1.0 if x is normalizedsharpness - adjusts steepness of curve (value of 1 equals undistorted sigmoid)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||