Package FAtiMA.Core.sensorEffector
Class Event
java.lang.Object
FAtiMA.Core.sensorEffector.Event
- All Implemented Interfaces:
Serializable,Cloneable
Represents an external event that happened in the virtual world
- Author:
- Joao Dias
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new EventCreates a new EventCreates a new event -
Method Summary
Modifier and TypeMethodDescriptionvoidAddParameter(Parameter param) Adds a Parameter to the event (usually arguments or parameters of the action)ApplyPerspective(String agentName) clone()Creates a new copy of the EventbooleanCompares the event against a given objectGenerates a List of bindings that associate the Variables [Subject], [Action],[Target],[P1],[P2],...Gets the event's actionGets the event's parameters (usually arguments or parameters of the action)shortGets the event's status (activation, success, failure for goal and success, failure for action)Gets the event's subject (Who performed the action)Meiyii 07/01/10 Gets the event's target (what is the target of the event's action)longGetTime()Gets the event's timeshortGetType()Meiyii 07/01/10 Gets the event's type (whether goal or action)voidMakeGround(ArrayList<Substitution> substitutions) Applies a set of substitutions to the object, grounding it.static booleanMatchEvent(Event matchRule, Event eventPerception) Receives two events and sees if they match.static EventParseEvent(String subject, String action, String target, String parameters) Parses an eventRemovePerspective(String agentName) voidSets the event's action (what happened)voidSetStatus(short status) Meiyii 07/01/10 Sets the event's status (activation, success, failure for goal and success, failure for action)voidSetSubject(String subject) Sets the event's subject (who performed the action)voidSets the event's target (what is the target of the event's action)voidSetType(short type) Meiyii 07/01/10 Sets the event's type (goal or action)toName()Converts the event to a NameConverts the event into the equivalent of a step's nametoString()Converts the event to a String
-
Field Details
-
_action
-
_parameters
-
_subject
-
_target
-
_time
protected long _time -
_status
protected short _status -
_type
protected short _type
-
-
Constructor Details
-
Event
Creates a new Event- Parameters:
subject- - the subject of the event (who performed the action)
-
Event
Creates a new Event- Parameters:
subject- - the subject of the event (who performed the action)action- - the action specified by the eventtarget- - the target of the action
-
Event
Creates a new event- Parameters:
subject- - the subject of the event (who performed the action)action- - the action specified by the eventtarget- - the target of the actiontype- - the type of eventstatus- - the status of the goal/action
-
Event
-
-
Method Details
-
MatchEvent
Receives two events and sees if they match. Two events match if they refer to the same subject, action, target and parameters- Parameters:
matchRule- - left Event to be matchedeventPerception- - right Event to be matched- Returns:
- true if the events match, false otherwise
-
ApplyPerspective
-
RemovePerspective
-
ParseEvent
Parses an event- Parameters:
subject-action-target-parameters-- Returns:
- the parsed Event
-
AddParameter
Adds a Parameter to the event (usually arguments or parameters of the action)- Parameters:
param- - the Parameter to add- See Also:
-
GetAction
Gets the event's action- Returns:
- the event's action
-
GetParameters
Gets the event's parameters (usually arguments or parameters of the action)- Returns:
- an ArrayList with all the parameters
- See Also:
-
GetSubject
Gets the event's subject (Who performed the action)- Returns:
- the event's subject
-
GetTarget
Meiyii 07/01/10 Gets the event's target (what is the target of the event's action)- Returns:
- the event's target
-
GetType
public short GetType()Meiyii 07/01/10 Gets the event's type (whether goal or action)- Returns:
- the event's type
-
GetStatus
public short GetStatus()Gets the event's status (activation, success, failure for goal and success, failure for action)- Returns:
- the event's status
-
GetTime
public long GetTime()Gets the event's time- Returns:
- the event's time
-
SetAction
Sets the event's action (what happened)- Parameters:
action- - the action to store in the event
-
SetSubject
Sets the event's subject (who performed the action)- Parameters:
subject- - the subject to store in the event
-
SetStatus
public void SetStatus(short status) Meiyii 07/01/10 Sets the event's status (activation, success, failure for goal and success, failure for action)- Parameters:
status- - the status of the event
-
SetType
public void SetType(short type) Meiyii 07/01/10 Sets the event's type (goal or action)- Parameters:
type- - the type of the event
-
SetTarget
Sets the event's target (what is the target of the event's action)- Parameters:
target- - the target to store in the event
-
equals
Compares the event against a given object -
clone
Creates a new copy of the Event -
MakeGround
Applies a set of substitutions to the object, grounding it. Only considers substitutions that start with [Subject],[Target], [Action],[P1],[P2], etc... Example: Applying the substitution "[Subject]/John" in the event, will replace the events subject with John Attention, this method modifies the original object.- Parameters:
substitutions- - A list of substitutions of the type "[Variable]/value"- See Also:
-
GenerateBindings
Generates a List of bindings that associate the Variables [Subject], [Action],[Target],[P1],[P2],... respectively to the event's subject, action, target and parameters- Returns:
- the mentioned list of substitutions
-
toName
Converts the event to a Name- Returns:
- the converted Name
- See Also:
-
toStepName
Converts the event into the equivalent of a step's name- Returns:
- a Name that corresponds to a Step's description
-
toString
Converts the event to a String
-