org.jactr.core.model
Interface IModel

All Superinterfaces:
IInitializable, IMetaContainer, IParameterized
All Known Implementing Classes:
BasicModel

public interface IModel
extends IParameterized, IMetaContainer, IInitializable

core model interface. the majority of functionality is distributed to the various modules that have been installed. It must have a IDeclarativeModule, IProceduralModule at minimal to run. IModules and IExtensions can only be installed, never removed - at least at this level of abstraction.

Author:
developer

Method Summary
 void addActivationBuffer(IActivationBuffer buffer)
          install a buffer into this model, usually called during a modules installation
 void addListener(IModelListener listener, java.util.concurrent.Executor executor)
           
 void addListener(IParameterListener listener, java.util.concurrent.Executor executor)
           
 void dispatch(ModelEvent modelEvent)
           
 void dispatch(ParameterEvent modelEvent)
           
 void dispose()
          release all resources
 IActivationBuffer getActivationBuffer(java.lang.String name)
          returned the named activation buffer.
 java.util.Collection<IActivationBuffer> getActivationBuffers()
          return the installed activation buffers
 void getActivationBuffers(java.util.Collection<IActivationBuffer> container)
           
 double getAge()
          age of the model used to shift the clock during runs
 long getCycle()
           
 ICycleProcessor getCycleProcessor()
           
 IDeclarativeModule getDeclarativeModule()
          return the declarative module - this is the primary access point for declarative memory operations and controls
 IExtension getExtension(java.lang.Class<? extends IExtension> extensionClass)
          return the extension that implements this interface.
 java.util.Collection<IExtension> getExtensions()
          return all the installed extensions
 IInstrument getInstrument(java.lang.Class<? extends IInstrument> instrumentClass)
           
 java.util.Collection<IInstrument> getInstruments()
           
 IModule getModule(java.lang.Class<? extends IModule> moduleClass)
          get the module that is of class.
 java.util.Collection<IModule> getModules()
          get all the installed moduels
 java.lang.String getName()
          everyone needs a name..
 IProceduralModule getProceduralModule()
          return the procedural module - this is the primary access point for procedural access and controls
 TimedEventQueue getTimedEventQueue()
          the model must have a timed event queue.
 boolean hasBeenInitialized()
          has this models intiialize been called
 boolean hasListeners()
           
 boolean hasParameterListeners()
           
 void initialize()
          initialize the model.
 void install(IExtension extension)
          install this extension
 void install(IInstrument installable)
          install some other installable element, attempting to install a module or an extention here will reroute it to the more specific methods.
 void install(IModule module)
          install an IModule into the model.
 void removeListener(IModelListener listener)
           
 void removeListener(IParameterListener listener)
           
 void setCycleProcessor(ICycleProcessor processor)
           
 void uninstall(IInstrument installable)
           
 
Methods inherited from interface org.jactr.core.utils.parameter.IParameterized
getParameter, getPossibleParameters, getSetableParameters, setParameter
 
Methods inherited from interface org.jactr.core.utils.IMetaContainer
getMetaData, getMetaDataKeys, setMetaData
 

Method Detail

initialize

void initialize()
                throws java.lang.Exception
initialize the model. This will call the initialize methods on all extensions, buffers, and installables (in that order) this is to be called after the model has been configured to a runnable point (chunks, types and productions have been installed) - allowing the initializable elements to attach any listeners. this will be called only once during the lifetime of the model. anything that is dependent upon the actual run of the model should attach a listener and catch the modelStarted() event.

Specified by:
initialize in interface IInitializable
Throws:
java.lang.Exception

dispose

void dispose()
release all resources


hasBeenInitialized

boolean hasBeenInitialized()
has this models intiialize been called

Returns:

getTimedEventQueue

TimedEventQueue getTimedEventQueue()
the model must have a timed event queue. this queue keeps track of all internal model time-based changes (such as posting the results of a retrieval). Most productions output a few timed events


addActivationBuffer

void addActivationBuffer(IActivationBuffer buffer)
install a buffer into this model, usually called during a modules installation

Parameters:
buffer -

getActivationBuffer

IActivationBuffer getActivationBuffer(java.lang.String name)
returned the named activation buffer. case sensitivity is up to the implementation

Parameters:
name -
Returns:

getActivationBuffers

java.util.Collection<IActivationBuffer> getActivationBuffers()
return the installed activation buffers


getActivationBuffers

void getActivationBuffers(java.util.Collection<IActivationBuffer> container)

install

void install(IModule module)
install an IModule into the model. if it is the declarative or procedural modules it will be installed as the models dec/proc module

Parameters:
module -

getDeclarativeModule

IDeclarativeModule getDeclarativeModule()
return the declarative module - this is the primary access point for declarative memory operations and controls

Returns:

getProceduralModule

IProceduralModule getProceduralModule()
return the procedural module - this is the primary access point for procedural access and controls

Returns:

getModule

IModule getModule(java.lang.Class<? extends IModule> moduleClass)
get the module that is of class. effectively getInstallable(IModule.class);

Parameters:
moduleClass -
Returns:
the module that implements Class, or null

getModules

java.util.Collection<IModule> getModules()
get all the installed moduels

Returns:

install

void install(IExtension extension)
install this extension

Parameters:
extension -

getExtension

IExtension getExtension(java.lang.Class<? extends IExtension> extensionClass)
return the extension that implements this interface. just getExtension(IExtension.class)

Parameters:
extensionClass -
Returns:

getExtensions

java.util.Collection<IExtension> getExtensions()
return all the installed extensions

Returns:

install

void install(IInstrument installable)
install some other installable element, attempting to install a module or an extention here will reroute it to the more specific methods.

Parameters:
installable -

uninstall

void uninstall(IInstrument installable)

getInstrument

IInstrument getInstrument(java.lang.Class<? extends IInstrument> instrumentClass)
Parameters:
instrumentClass -
Returns:

getInstruments

java.util.Collection<IInstrument> getInstruments()

addListener

void addListener(IModelListener listener,
                 java.util.concurrent.Executor executor)

removeListener

void removeListener(IModelListener listener)

hasListeners

boolean hasListeners()

dispatch

void dispatch(ModelEvent modelEvent)

addListener

void addListener(IParameterListener listener,
                 java.util.concurrent.Executor executor)

removeListener

void removeListener(IParameterListener listener)

hasParameterListeners

boolean hasParameterListeners()

dispatch

void dispatch(ParameterEvent modelEvent)

getName

java.lang.String getName()
everyone needs a name..

Returns:

getCycle

long getCycle()

getAge

double getAge()
age of the model used to shift the clock during runs

Returns:

getCycleProcessor

ICycleProcessor getCycleProcessor()

setCycleProcessor

void setCycleProcessor(ICycleProcessor processor)