crowdmodel.agents
Class MemoryElement

java.lang.Object
  extended by crowdmodel.agents.MemoryElement
Direct Known Subclasses:
Fact, Goal, Rule

public abstract class MemoryElement
extends java.lang.Object

A memoryElement is a component of the Memory. Represents an atom of knowledge in this structure. The forms of knowledge are either a goal, a fact or a rule specified in the derived classes In general, every memoryElement can be activated, which makes it more salient (approachable), and is linked to other memory elements in an associative way (i.e. stronger, weaker links).


Field Summary
(package private)  double d_activation
           
protected  double d_baseLevel
           
protected  double d_contextLevel
           
(package private)  int d_id
           
private static int d_K
           
private  double d_n
           
(package private)  java.lang.String d_name
           
private  java.util.LinkedList<java.lang.Double> d_T
           
private  double d_Tfirst
           
(package private)  CrowdAgent d_thisAgent
           
(package private)  boolean d_thisAgentFlag
           
(package private)  Memory d_thisMemory
           
(package private)  boolean d_thisMemoryFlag
           
private  double d_tLastPrime
           
 
Constructor Summary
MemoryElement()
          Constructor
 
Method Summary
 void approxB()
          Function calculates the approximation of the base-level activation of a memoryElement.
 void contextActivation()
           
 double getActivation()
           
 int getID()
           
 double getLastPrimeTime()
          Returns the tick in which this memoryElement was lastly primed
 java.lang.String getName()
           
 void prime()
          Primes a memoryElement Psy terms: This means that a concept in memory is getting more salient/dominant.
 void setThisAgent(CrowdAgent thisAgent)
          Sets the Agent where this MemoryElement belongs to This allows for the 'direct' access of methods/vars concerning the Agent by the functions in the MemoryElements; The function checks whether this has already been assigned, at this is only done once while initialising.
 void setThisMemory(Memory thisMemory)
          Sets the Memory where this MemoryElement belongs to This allows for the 'direct' access of methods/vars concerning memory by the functions in the MemoryElements; The function checks whether this has already been assigned, at this is only done once while initialising.
 java.lang.String toString()
           
 void updateActivation()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

d_id

int d_id

d_thisAgent

CrowdAgent d_thisAgent

d_thisMemory

Memory d_thisMemory

d_thisAgentFlag

boolean d_thisAgentFlag

d_thisMemoryFlag

boolean d_thisMemoryFlag

d_name

java.lang.String d_name

d_activation

double d_activation

d_baseLevel

protected double d_baseLevel

d_contextLevel

protected double d_contextLevel

d_K

private static final int d_K
See Also:
Constant Field Values

d_Tfirst

private double d_Tfirst

d_T

private java.util.LinkedList<java.lang.Double> d_T

d_n

private double d_n

d_tLastPrime

private double d_tLastPrime
Constructor Detail

MemoryElement

public MemoryElement()
Constructor

Method Detail

prime

public void prime()
Primes a memoryElement Psy terms: This means that a concept in memory is getting more salient/dominant. Coding: the (base-level) activation of this element increases given a function TODO: uitleggen onderscheid priming en updaten (objective vs subjective). De functie dat deze gebaseerd is op de memory theory van Anderson, die ook gebruikt is in bijv. ACT-R empirisch bewijs EN ref pags in thesis When an element is primed it 'uses' the element, resulting in an increased activation It stores the time in d_T


contextActivation

public void contextActivation()

approxB

public void approxB()
Function calculates the approximation of the base-level activation of a memoryElement. Base-level activation is a part of the total activation of a memory element that describes the recency and frequency of use of this particular element. This computational efficient approximation function (Petrov 2006) generates the typical base-level activation dynamics: sharp peak directly after usage, decay in absence of use, and gradual accretion with frequent use. It is more efficient as it does not need to register every usage of the memory element, it is only stored the last k-times it was used. B = ln (SUM(1/sqrt(ti) + ((2(n-k))/(sqrt(tn) + sqrt(tk))); ti = registered time (of usage) with index i
n = number of times the element is used since it exists
k = depth variable. Indicates the number items to be stored that represent the historic time of usage of this element. Here d_K = 1, as Petrov (2006) indicates that it works already very good.
i = Index (i) allows for finding the stored time-step (ti) of history element usage.
tn = lifespan, corresponds with the time a memory element started to exist, whereas (n) represents the total number of uses.
tk = usespan, time since the Kth-storage. t_now - t_kth_usage = d_t - d_T[k]. As the history of usage is kept in a linkedList it is the last element that represents kth-usage.
Implementation: Time registrations are stored in a linked list (d_T) that is restricted in having k slots. Follows a FIFO queueing principle.
d_K = k (depth variable) lifeSpan = tn ; useSpan = tk d_Tfirst = time on which the element started to exist currentTime = current simulation time


updateActivation

public void updateActivation()

setThisAgent

public void setThisAgent(CrowdAgent thisAgent)
Sets the Agent where this MemoryElement belongs to This allows for the 'direct' access of methods/vars concerning the Agent by the functions in the MemoryElements; The function checks whether this has already been assigned, at this is only done once while initialising. As this cannot be done in the constructor this is the 'ugly' solution. Cannot be done because the agent gives itself as a parameter and in the constructor the creation of this object is not ready yet, so it is not possible to give itself as an argument.

Parameters:
thisAgent -

setThisMemory

public void setThisMemory(Memory thisMemory)
Sets the Memory where this MemoryElement belongs to This allows for the 'direct' access of methods/vars concerning memory by the functions in the MemoryElements; The function checks whether this has already been assigned, at this is only done once while initialising. As this cannot be done in the constructor this is the 'ugly' solution.

Parameters:
thisAgent -

getName

public java.lang.String getName()
Returns:
Name of the memory element

getActivation

public double getActivation()
Returns:
activation value of the memory element

getID

public int getID()
Returns:
the unique ID number of this Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getLastPrimeTime

public double getLastPrimeTime()
Returns the tick in which this memoryElement was lastly primed