Memory access

From SIMA wiki
Jump to: navigation, search

The long term memory access of ARS is divided into three layers according to the layered architecture pattern. In the first layer the “Application Layer”, the top level modules of ARS are accessing the memory search via the associated interface itfModuleMemoryAccess. On the next laxer, the “Service Layer”, search methods and manipulation of retrieved data is handled, including the execution of psychic spread activation. The data is received via the itfSearchSpaceAccess from the “Database Layer”, where the direct communication with the memory storage is positioned.

Psychic spread activation is implemented as a part of the memory retrieval, which is triggered by the top level modules of ARS in clsModuleBaseKB. Via the interface itfModuleMemoryAccess and its implementation clsLongTermMemoryHandler Psychic Spread Activation is addressed. In the class clsPsychicSpreadActivation the recursive method startSpreadActivation() initiates the search. Its inputs are the input image of the class clsThingPresentationMesh, psychic energy and a list of already activated images. The class structure, which is kept simple, is shown in Figure 1 10. In a first step, the direct associations to the input image are created or the indirect associations of the input image are loaded. In the first case, each the image is compared with all images of the memory and those images are returned with their match, as calculated in 1.5.3. This match is used as association weight in the direct associations and in that way the input image is extended into a mesh of images. In the case of indirect associations, the mesh of the immediate associations with other images is directly loaded from the memory. As a result, the input image is extended with all directly associable images.

In a next step, the actual activation is calculated, as here only images are loaded, but it is not known, which of the shall actually be used in the later processing. As this is a recursive process, it has to be assured that the same image is not activated twice. Therefore, all input images are added to a list, which is checked before starting the activation. For each (not already activated) associated image, the node class clsPsychicSpreadActivationNode is created. Here all results of the calculations described in chapter 1.5.4 are performed. The node class is used as an umbrella structure for each image. Then, all images which are not to be activated by the psychic spread activation are removed from the input image. Only the activated images remain. For each of the newly activated images, which is provided with allocated psychic energy, the method startSpreadActivation() is started. This recursion is done as long as any images can be activated, i.e. the input psychic energy of an image > 0. This implementation was explicitly adapted to be used as an additional layer on top of an already present memory search. It is necessary to load the images from the database and then process them with the psychic spread activation. As the psychic potential and the allocation of psychic energy has to be calculated for each image and it is dependent on the available psychic energy as well as on the psychic potential of the other associated images, they have to be newly processed at each search cycle.


Jetzt gibt es nur den folgenden Memoryzugriff für die Module über den clsModuleBaseKB:

public interface itfModuleMemoryAccess

      /**
      * Search for a general single entity or data structure
      * 
       * (wendt)
      *
      * @since 26.02.2013 11:13:47
      *
      * @param poDataType
      * @param poPattern
      * @return
      */
      public <E> ArrayList<ArrayList<clsPair<Double, clsDataStructureContainer>>> searchEntity (eDataType poDataType, ArrayList<E> poPattern);
      /**
      * From the input data like, content, shape and color, the matching TPM is loaded from the memory
      * 
       * (wendt)
      *
      * @since 26.02.2013 11:24:24
      *
      * @param poContent
      * @param poShape
      * @param poColor
      * @return
      */
      public clsThingPresentationMesh searchExactEntityFromInternalAttributes(String poContent, String poShape, String poColor);
      /**
      * Search for images according to the input pattern
      * Usage: Fill libido discharge and repressed content
      * 
       * (wendt)
      *
      * @since 26.02.2013 11:18:27
      *
      * @param poPattern
      * @param poSearchContentType
      * @param prThreshold
      * @param pnLevel
      * @return
      */
      public ArrayList<clsPair<Double, clsDataStructurePA>> searchMesh(clsDataStructurePA poPattern, eContentType poSearchContentType, double prThreshold, int pnLevel);
      /**
      * Search a whole mesh, i. e. for an input image, search for the associated data structures for this mesh
      * 
       * (wendt)
      *
      * @since 26.02.2013 11:20:13
      *
      * @param poInput
      * @param pnLevel
      * @return
      */
      public clsDataStructurePA searchCompleteMesh(clsDataStructurePA poInput, int pnLevel);
      /**
      * Execute psychic spread activation for an image of the primary process
      * 
       * (wendt)
      *
      * @since 26.02.2013 11:21:05
      *
      * @param poInput
      * @param prPsychicEnergyIn
      */
      public void executePsychicSpreadActivation(clsThingPresentationMesh poInput, double prPsychicEnergyIn);
      /**
      * Get the secondary process data structure from a primary process data structure
      * 
       * (wendt)
      *
      * @since 26.02.2013 11:21:40
      *
      * @param poDataStructure
      * @param prThreshold
      * @return
      */
      public clsAssociationWordPresentation getSecondaryDataStructure(clsPrimaryDataStructure poDataStructure, double prThreshold);