XML syntax of PoJACT-R models

For playing with PoJACT-R you has to know syntax of model. Official DTD od XML Schema of model files for jACT-R doesn't exists, mainly because jACT-R is still in developement. In this chapter we will show you basic elements of jACT-R model on mindless.jactr.

Definition of model

XML is language with tree structure. Root is definition of model:

<?xml version="1.0" encoding="UTF-8"?>
<actr>
    <model name="SimplePoJACTRAgent" >

Definition of modules

For defining modul it is required full name of class that implements interface IModule. If modul is parametrized, it has to implements IParametrized. If you are interesting into implementing new modules you will find usefull some preimplemented abstract classes (i.e AbstractPerceptualModule).

<modules>
  <module class="org.jactr.core.module.declarative.six.DefaultDeclarativeModule6">
    <parameters>
      <parameter name="ActivationNoise" value="0.1"/>
      ...
    </parameters>
  </module>
  ...
</modules>

Definition of declarative memory

Declarative memory has to have defined all chunk types that is used by jACT-R. Every chunk has to have defined name, his slots and his implicit values. Then model can use chunks of defined chunk type. Some chunk types are defined automaticly by modules or buffers by special chunk factories (i.e. auralChunkType in AuralChunkFactory)

<declarative-memory>
  <chunk-type name="count-order" >
    <slot name="first" equals="nil"/>
    <slot name="second" equals="nil"/>
  </chunk-type>
    ...
  <chunk name="a" type="count-order" >
    <slot name="first" equals="0.0"/>
    <slot name="second" equals="1.0"/>
  </chunk>
    ...
</declarative-memory>

Definition of procedural memory

Procedural memory contains all production rules. Tag condition define condition part, which is something like template for matching in first phase of cognitive cycle. Tag match says which chunk has to be in which buffer to enables production rule.

  • equals="value": says that value has to be "value"

  • not="value": says that value has not to be "value"

  • equals="=var": maps value on variable var for later usage in execution part

Tag action defines executive part of production. Currently supported tags are:

  • modify: modify chunk in buffer

  • add: add chunk to buffer

  • output: prints output

<procedural-memory>
  <production name="pogamutTestJump">
    <condition>
      <match buffer="goal" type="pogamutGoalChunk">
        <slot name="waitFor" equals="jumpOnRocket"/>
      </match>
      <match buffer="defaultAuralActivationBuffer" type="auralChunk">
        <slot name="class" equals="XWeapons.RocketLauncher"/>
      </match>
    </condition>
    <action>
      <modify buffer="goal">
        <slot name="waitFor" equals="somethingElse"/>
      </modify>
      <add buffer="movementCommandBuffer" type="commandChunk">
        <slot name="command" equals="jump"/>
      </add>
      <output>"Jumping !!"</output>
    </action>
  </production>
  ...
<procedural-memory>

Definition of buffers

Last section define all buffers, with which model can work. Buffer has to implement interface IActivationBuffer and if it is parametrized interface IParametrized.

<buffer name="defaultAuralActivationBuffer" >
  <parameters>
  ...
  </parameters>
</buffer>