jchrest.architecture
Class Chrest

java.lang.Object
  extended by java.util.Observable
      extended by jchrest.architecture.Chrest

public class Chrest
extends java.util.Observable

The parent class for an instance of a Chrest model.


Constructor Summary
Chrest()
           
 
Method Summary
 void advanceClock(int time)
          Advance the clock by given amount.
 void clear()
          Clear the STM and LTM of the model.
 void constructTemplates()
          Instruct model to construct templates, if the 'constructTemplates' flag is true.
 int countTemplates()
          Return a count of the number of templates in the model's visual LTM.
 ListPattern followPattern(ListPattern pattern)
          Asks Chrest to return the image of the node which follows the node obtained by sorting given pattern through the network.
 void freeze()
          Instruct model not to update observers.
 double getActionLtmAverageDepth()
          Return the average depth of nodes in action long-term memory.
 int getAddLinkTime()
          Accessor to retrieve time to add a new link.
 int getClock()
          Accessor to retrieve current time of model.
 java.util.Map<java.lang.Integer,java.lang.Integer> getContentCounts()
          Return a map from content sizes to frequencies for the model's LTM.
 boolean getCreateTemplates()
          Accessor to option of whether to create templates.
 int getDiscriminationTime()
          Accessor to retrieve time to discriminate a new node.
 DomainSpecifics getDomainSpecifics()
          Retrieve the model's current domain specification.
 int getFamiliarisationTime()
          Accessor to retrieve time to familiarise image of a node.
 java.lang.String getHeuristicDescription()
           
 java.util.Map<java.lang.Integer,java.lang.Integer> getImageCounts()
          Return a map from image sizes to frequencies for the model's LTM.
 Node getLtmByModality(ListPattern pattern)
          Return the root node of the long-term memory which the given pattern would be sorted through, based on its modality.
protected  int getMinTemplateLevel()
          Accessor to value of minimum template level.
protected  int getMinTemplateOccurrences()
          Accessor to minimum require occurrences for forming template.
 Perceiver getPerceiver()
          Accessor to retrieve the model's perceiver object.
 float getRho()
          Accessor to retrieve value of rho, the probability of learning an item.
 java.util.Map<java.lang.Integer,java.lang.Integer> getSimilarityCounts()
          Return a map from number of similarity nodes to frequencies for the model's LTM.
 float getSimilarityThreshold()
          Accessor to retrieve value of similarity threshold, the number of items which must be shared between two images for a similarity link to be formed.
 int getTotalLtmNodes()
          Accessor to retrieve the total number of nodes within LTM.
 double getVerbalLtmAverageDepth()
          Return the average depth of nodes in verbal long-term memory.
 Stm getVerbalStm()
          Accessor to retrieve verbal short-term memory of model.
 int getVerbalStmSize()
          Accessor to retrieve the size of verbal short-term memory.
 Node getVisualLtm()
          Accessor to retrieve visual long-term memory of model.
 double getVisualLtmAverageDepth()
          Return the average depth of nodes in visual long-term memory.
 double getVisualLtmAverageImageSize()
          Return the average image size of nodes in visual long-term memory.
 Stm getVisualStm()
          Accessor to retrieve visual short-term memory of model.
 int getVisualStmSize()
          Accessor to retrieve the size of visual short-term memory.
 void learnAndLinkPatterns(ListPattern pattern1, ListPattern pattern2)
          Learns the two patterns assuming the time of presentation is the current Chrest clock time.
 void learnAndLinkPatterns(ListPattern pattern1, ListPattern pattern2, int time)
          Presents Chrest with a pair of patterns, which it should learn and then attempt to learn a link.
 void learnAndNamePatterns(ListPattern pattern1, ListPattern pattern2)
           
 void learnAndNamePatterns(ListPattern pattern1, ListPattern pattern2, int time)
          Learn and link a visual and verbal pattern with a naming link.
 void learnScene(Scene scene, int numFixations)
           
 int ltmActionSize()
          Return a count of the number of nodes in action long-term memory.
 int ltmVerbalSize()
          Return a count of the number of nodes in verbal long-term memory.
 int ltmVisualSize()
          Return a count of the number of nodes in visual long-term memory.
 ListPattern namePattern(ListPattern pattern)
          Asks Chrest to return the image of the node which names the node obtained by sorting given pattern through the network.
 ListPattern recallPattern(ListPattern pattern)
          Asks Chrest to return the image of the node obtained by sorting given pattern through the network.
 Node recognise(ListPattern pattern)
          Retrieve a node in long-term memory using the given ListPattern.
 Node recogniseAndLearn(ListPattern pattern)
           
 Node recogniseAndLearn(ListPattern pattern, int time)
          Use given ListPattern to perform a step of learning within the network.
 Scene scanScene(Scene scene, int numFixations)
          Scan given scene, then return a scene which would be recalled.
 Scene scanScene(Scene scene, int numFixations, boolean clearStm)
          Scan given scene, then return a scene which would be recalled.
 void setAddLinkTime(int time)
          Modify time to add a new link.
 void setCreateTemplates(boolean value)
          Modify option to create templates.
 void setDiscriminationTime(int time)
          Modify time to discriminate a new node.
 void setDomain(DomainSpecifics domain)
          Set the domain specification.
 void setFamiliarisationTime(int time)
          Modify time to familiarise image of a node.
 void setRho(float rho)
          Modify value of rho, the probability of learning an item.
 void setSimilarityThreshold(int threshold)
          Modify value of similarity threshold.
 void setTemplateConstructionParameters(int minLevel, int minOccurrences)
          Modify values for template construction.
 void setVerbalStmSize(int size)
          Modify size of verbal short-term memory.
 void setVisualStmSize(int size)
          Modify size of visual short-term memory.
 void unfreeze()
          Instruct model to now update observers for future changes.
 void writeModelAsVna(java.io.Writer writer)
          Write model to given Writer object in VNA format
 void writeModelSimilarityLinksAsVna(java.io.Writer writer)
          Write model similarity links to given Writer object in VNA format
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Chrest

public Chrest()
Method Detail

getDomainSpecifics

public DomainSpecifics getDomainSpecifics()
Retrieve the model's current domain specification.


setDomain

public void setDomain(DomainSpecifics domain)
Set the domain specification.


getAddLinkTime

public int getAddLinkTime()
Accessor to retrieve time to add a new link.


setAddLinkTime

public void setAddLinkTime(int time)
Modify time to add a new link.


getDiscriminationTime

public int getDiscriminationTime()
Accessor to retrieve time to discriminate a new node.


setDiscriminationTime

public void setDiscriminationTime(int time)
Modify time to discriminate a new node.


getFamiliarisationTime

public int getFamiliarisationTime()
Accessor to retrieve time to familiarise image of a node.


setFamiliarisationTime

public void setFamiliarisationTime(int time)
Modify time to familiarise image of a node.


getRho

public float getRho()
Accessor to retrieve value of rho, the probability of learning an item.


setRho

public void setRho(float rho)
Modify value of rho, the probability of learning an item.


getSimilarityThreshold

public float getSimilarityThreshold()
Accessor to retrieve value of similarity threshold, the number of items which must be shared between two images for a similarity link to be formed.


setSimilarityThreshold

public void setSimilarityThreshold(int threshold)
Modify value of similarity threshold.


setCreateTemplates

public void setCreateTemplates(boolean value)
Modify option to create templates.


getCreateTemplates

public boolean getCreateTemplates()
Accessor to option of whether to create templates.


getMinTemplateLevel

protected int getMinTemplateLevel()
Accessor to value of minimum template level.


getMinTemplateOccurrences

protected int getMinTemplateOccurrences()
Accessor to minimum require occurrences for forming template.


setTemplateConstructionParameters

public void setTemplateConstructionParameters(int minLevel,
                                              int minOccurrences)
Modify values for template construction.


getVisualStmSize

public int getVisualStmSize()
Accessor to retrieve the size of visual short-term memory.


setVisualStmSize

public void setVisualStmSize(int size)
Modify size of visual short-term memory.


getVerbalStmSize

public int getVerbalStmSize()
Accessor to retrieve the size of verbal short-term memory.


setVerbalStmSize

public void setVerbalStmSize(int size)
Modify size of verbal short-term memory.


getClock

public int getClock()
Accessor to retrieve current time of model.


advanceClock

public void advanceClock(int time)
Advance the clock by given amount.


getTotalLtmNodes

public int getTotalLtmNodes()
Accessor to retrieve the total number of nodes within LTM.


getVisualStm

public Stm getVisualStm()
Accessor to retrieve visual short-term memory of model.


getVerbalStm

public Stm getVerbalStm()
Accessor to retrieve verbal short-term memory of model.


getVisualLtm

public Node getVisualLtm()
Accessor to retrieve visual long-term memory of model.


ltmVisualSize

public int ltmVisualSize()
Return a count of the number of nodes in visual long-term memory.


getVisualLtmAverageDepth

public double getVisualLtmAverageDepth()
Return the average depth of nodes in visual long-term memory.


getVisualLtmAverageImageSize

public double getVisualLtmAverageImageSize()
Return the average image size of nodes in visual long-term memory.


ltmVerbalSize

public int ltmVerbalSize()
Return a count of the number of nodes in verbal long-term memory.


getVerbalLtmAverageDepth

public double getVerbalLtmAverageDepth()
Return the average depth of nodes in verbal long-term memory.


ltmActionSize

public int ltmActionSize()
Return a count of the number of nodes in action long-term memory.


getActionLtmAverageDepth

public double getActionLtmAverageDepth()
Return the average depth of nodes in action long-term memory.


constructTemplates

public void constructTemplates()
Instruct model to construct templates, if the 'constructTemplates' flag is true. This method should be called at the end of the learning process. Note, the template construction process only currently works for visual patterns using the ItemSquarePattern primitive.


countTemplates

public int countTemplates()
Return a count of the number of templates in the model's visual LTM.


getLtmByModality

public Node getLtmByModality(ListPattern pattern)
Return the root node of the long-term memory which the given pattern would be sorted through, based on its modality.


freeze

public void freeze()
Instruct model not to update observers.


unfreeze

public void unfreeze()
Instruct model to now update observers for future changes. Also triggers an immediate update of current observers.


getContentCounts

public java.util.Map<java.lang.Integer,java.lang.Integer> getContentCounts()
Return a map from content sizes to frequencies for the model's LTM.


getImageCounts

public java.util.Map<java.lang.Integer,java.lang.Integer> getImageCounts()
Return a map from image sizes to frequencies for the model's LTM.


getSimilarityCounts

public java.util.Map<java.lang.Integer,java.lang.Integer> getSimilarityCounts()
Return a map from number of similarity nodes to frequencies for the model's LTM.


getPerceiver

public Perceiver getPerceiver()
Accessor to retrieve the model's perceiver object.


recognise

public Node recognise(ListPattern pattern)
Retrieve a node in long-term memory using the given ListPattern. The sorting process works through the children of the currentNode. If the link's test matches the remaining part of the pattern, then the current node is updated, and searching continues through the children of the new node.


recogniseAndLearn

public Node recogniseAndLearn(ListPattern pattern,
                              int time)
Use given ListPattern to perform a step of learning within the network. First, the pattern is sorted. Then, if the retrieved node is the root node or its image mismatches the pattern, discrimination is used to extend the network. Otherwise, new information will be added to the image using the pattern.


recogniseAndLearn

public Node recogniseAndLearn(ListPattern pattern)

recallPattern

public ListPattern recallPattern(ListPattern pattern)
Asks Chrest to return the image of the node obtained by sorting given pattern through the network.


followPattern

public ListPattern followPattern(ListPattern pattern)
Asks Chrest to return the image of the node which follows the node obtained by sorting given pattern through the network.


namePattern

public ListPattern namePattern(ListPattern pattern)
Asks Chrest to return the image of the node which names the node obtained by sorting given pattern through the network.


learnAndLinkPatterns

public void learnAndLinkPatterns(ListPattern pattern1,
                                 ListPattern pattern2,
                                 int time)
Presents Chrest with a pair of patterns, which it should learn and then attempt to learn a link.


learnAndLinkPatterns

public void learnAndLinkPatterns(ListPattern pattern1,
                                 ListPattern pattern2)
Learns the two patterns assuming the time of presentation is the current Chrest clock time.


learnAndNamePatterns

public void learnAndNamePatterns(ListPattern pattern1,
                                 ListPattern pattern2,
                                 int time)
Learn and link a visual and verbal pattern with a naming link.


learnAndNamePatterns

public void learnAndNamePatterns(ListPattern pattern1,
                                 ListPattern pattern2)

learnScene

public void learnScene(Scene scene,
                       int numFixations)

scanScene

public Scene scanScene(Scene scene,
                       int numFixations)
Scan given scene, then return a scene which would be recalled. Default behaviour is to clear STM before scanning a scene.


scanScene

public Scene scanScene(Scene scene,
                       int numFixations,
                       boolean clearStm)
Scan given scene, then return a scene which would be recalled.


clear

public void clear()
Clear the STM and LTM of the model.


getHeuristicDescription

public java.lang.String getHeuristicDescription()

writeModelAsVna

public void writeModelAsVna(java.io.Writer writer)
                     throws java.io.IOException
Write model to given Writer object in VNA format

Throws:
java.io.IOException

writeModelSimilarityLinksAsVna

public void writeModelSimilarityLinksAsVna(java.io.Writer writer)
                                    throws java.io.IOException
Write model similarity links to given Writer object in VNA format

Throws:
java.io.IOException