cz.cuni.amis.pogamut.episodic.episodes
Class ObjectSlot

Package class diagram package ObjectSlot
java.lang.Object
  extended by cz.cuni.amis.pogamut.episodic.episodes.ObjectSlot
All Implemented Interfaces:
Serializable

public class ObjectSlot
extends Object
implements Serializable

As episode tree can be imagined as experienced instance of the decision tree, ObjectSlot can is an experienced equivalent of AffordanceSlot. Of course several ObjectSlots can be associated with one AffordanceSlot. ObjectSlots can be attached to any action or intention episode node (same as affordance slots can be attached to decision nodes). It represent the object being used while performing specified action. In order for action to be completed successfully all slots have to be filled by particular items first. However if no such object was found, the slot still exists in memory, it just isn't linked with any object. Slots are the only was how to remember that an object was used to perform an action.

Author:
Michal Cermak
See Also:
Serialized Form

Constructor Summary
ObjectSlot(int _id, String _type, EpisodeNode parent)
          Instantiate the slot class by providing unique ID that will be used for visualizing purposes, type of objects that are needed to fill this slot and reference to the node, this slot is attached to.
 
Method Summary
 boolean addObject(ObjectNode obj, boolean increaseCounter)
          Links an this slot with given ObjectNode representing and object.
 Collection<Double> computeScore()
          Method used to compute the new score of a slot.
 boolean deleteSlot()
          Deletes the slot.
 void emptySlot()
          This method can be to unlink all ObjectNodes that were previously linked with this slot.
 void forgetConnections(double kScore)
           
 int getId()
          Getter method for the id variable.
 EpisodeNode getParentNode()
          Getter method for the parentNode variable.
 Collection<Double> getScore()
          Getter method for the objects.values() (scores) variable.
 double getScore(ObjectNode o)
          Returns score of connection with particular object.
 String getType()
          Getter method for the type variable.
 Collection<ObjectNode> getUsedObjects()
          A getter method for the objects variable.
 void remove(ObjectNode o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectSlot

public ObjectSlot(int _id,
                  String _type,
                  EpisodeNode parent)
Instantiate the slot class by providing unique ID that will be used for visualizing purposes, type of objects that are needed to fill this slot and reference to the node, this slot is attached to.

Parameters:
_id - Unique ID of this node.
_type - Type of the slot. No two slots of the same type can be attached to the one episodic node.
parent - Reference to the node, this slot is attached to.
Method Detail

getId

public int getId()
Getter method for the id variable.

Returns:
Returns ID of this node. Used as an ID of vertex representing this node when visualizing Chronobag View.

getType

public String getType()
Getter method for the type variable.

Returns:
Returns type of an object that can fill this slot. Each of the slots attached to an episodic node has to have a unique type.

getParentNode

public EpisodeNode getParentNode()
Getter method for the parentNode variable.

Returns:
Returns s reference to EpisodeNode this slot is attached to.

emptySlot

public void emptySlot()
This method can be to unlink all ObjectNodes that were previously linked with this slot. After calling this method it is ensured that the slot will not be connected with any object node. It will not be possible to recover information 'what object was used to perform the parent episodic node' from memory.

Can be used to simulate the forgetting process.


remove

public void remove(ObjectNode o)

addObject

public boolean addObject(ObjectNode obj,
                         boolean increaseCounter)
Links an this slot with given ObjectNode representing and object. In agent's memory this object will be remembered as item that was used to perform the episodic node this slot is attached to.

Parameters:
obj - Reference to an ObjectNode that is to be linked with this slot.
Returns:
Returns true if new object was linked with the slot. Returns false if the object was already linked with the slot and no new connection was created.

getUsedObjects

public Collection<ObjectNode> getUsedObjects()
A getter method for the objects variable.

Returns:
Returns collection of ObjectNodes representing objects that satisfy this affordance. Usually there will be just one object, but it is possible to have several objects of the same type in one slot. According to agent's memories these objects were used to perform the episodic node this slot is attached to.

getScore

public Collection<Double> getScore()
Getter method for the objects.values() (scores) variable.

Returns:
Returns Score of a slot. Used to determine if the link between the episode node and the object node can be forgotten.

computeScore

public Collection<Double> computeScore()
Method used to compute the new score of a slot. Used to determine if the link between the episode node and the object node can be forgotten.

Returns:
Returns the new score value of this slot.

deleteSlot

public boolean deleteSlot()
Deletes the slot. Before the slot is unlinked from all the object nodes and parent episode node, all its filling objects are moved to "Other" type slot on parent node.

Returns:
Returns true.

forgetConnections

public void forgetConnections(double kScore)

getScore

public double getScore(ObjectNode o)
Returns score of connection with particular object.

Parameters:
o - ObjectNode we are querying for.
Returns:
Returns the score of object connection with this slot. Returns zero if the slot is not connected to the parameter node.


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.