[This is preliminary documentation and is subject to change.]

This is parameters class for the MetaCognitiveModule class

Namespace: Clarion.Framework.Templates
Assembly: CLARIONLibrary (in CLARIONLibrary.dll) Version: 6.1.0.7 (6.1.0.7)

Syntax

C#
public class MetaCognitiveModuleParameters

Remarks

This class contains all of the parameters that may be used by the MetaCognitiveModule class. All classes that extend MetaCognitiveModule should also contain their own parameters class that extends this class and adds any parameters that are used by those classes. This is how all of the "built-in" modules within the CLARION Library have been implemented. It is HIGHLY recommended that users defining their own (custom) module follow this convention as well. Details on how to implement a parameters class for a custom module can be found in the Developer Tutorial upon request.

Note

The parameters classes can be found throughout the CLARION Library whenever a class contains parameters that may be set by a user. This concept was implemented to allow for some "special capabilities" and also to clean-up/streamline parameter usage throughout the system. The parameters classes enable parameters to be adjusted both locally and globally. In general, global parameter changes are performed statically through the GlobalParameters property and local parameter changes are performed on single instances through the Parameters property.

Examples demonstrating how parameter adjustments may be performed using both methods can be found in the examples section.
Note
Global parameter settings are ONLY applicable prior to the initialization of an instance of a module. During the initialization process, the global parameter settings are used to set the "default" values of the local parameters for a module. Once initialized, the module will only use the local parameters. Therefore, global parameter changes SHOULD ALWAYS be performed BEFORE instances of a module are initialized.

Copyright 2011. Nicholas Wilson

Examples

Suppose you wanted to change the "PERFORM_REFINEMENT" parameter for a single instance of a class derived from MetaCognitiveModule. This constitutes a "local" parameter change and is accomplished as follows:
CopyC#
SomeMetaCognitiveModuleSubclass mod;

// Elided code containing the initialization of mod using the <see cref="T:Clarion.AgentInitializer" />

mod.Parameters.PERFORM_REFINEMENT = true;     //Note that PERFORM_REFINEMENT is already true by default, so this doesn't actually change anything.
Now, suppose instead that you wanted to change the "PERFORM_REFINEMENT" parameter for all instances of all classes derived from MetaCognitiveModule. This constitutes a "global" (or static, in programming terms) parameter change and is accomplished as follows:
CopyC#
MetaCognitiveModule.GlobalParameters.PERFORM_REFINEMENT = false;

// Elided code containing the initialization of particular MetaCognitiveModule instances (as was demonstrated above)
Furthermore, suppose you wanted to change the "PERFORM_REFINEMENT" parameter for ONLY those modules that are derived from a specific subclass of MetaCognitiveModule. This can be accomplished in much the same way as was demonstrated above:
CopyC#
SomeClarionComponentSubclass.GlobalParameters.PERFORM_REFINEMENT = false;

// Elided code containing the initialization of particular MetaCognitiveModule instances (as was demonstrated above)
Caution

Changing a parameter globally at a specific point on the inheritance hierarchy (as was demonstrated above) requires that the parameter in question be overridden (or hidden) at that point in the hierarchy. In other words, although all parameters defined within the base classes of a subclass of MetaCognitiveModule are globally changeable at any point in the hierarchy, if the subclass does not override (or hide) a parameter, then ANY change made globally to that parameter will be applied at the level where that parameter was last overridden, regardless of the particular subclass in which the global parameter change is initiated.

For example, suppose there is a subclass of MetaCognitiveModule called "SomeOtherMetaCognitiveModule" whose parameters class extends MetaCognitiveModuleParameters but does not override PERFORM_REFINEMENT. In this case, performing the following global parameter change:
CopyC#
SomeOtherMetaCognitiveModule.GlobalParameters.PERFORM_REFINEMENT = false;
will actually change the "PERFORM_REFINEMENT" parameter at the MetaCognitiveModuleParameters level. In other words, the command above does the same thing as:
CopyC#
MetaCognitiveModule.GlobalParameters.PERFORM_REFINEMENT = false;

Keep this in mind when you are performing global parameter changes as it could cause unintended consequences during runtime. For the "built-in" modules in the CLARION Library, if a parameter was not overridden at a certain point in the inheritance hierarchy, then, in all likelihood, it is not used by that module.

As a general rule of thumb (when creating a custom module), if your module makes use of a parameter that was defined in a base class of that module, then you should override that parameter in your module's parameters class. This will allow users of your module to globally change that parameter at either the base class level or the level of your module. Details on how to correctly implement this can be found in the Developers Tutorial upon request.

Inheritance Hierarchy

System..::..Object
  Clarion.Framework.Templates..::..MetaCognitiveModule..::..MetaCognitiveModuleParameters
    Clarion.Framework.Extensions..::..ParameterSettingModule..::..ParameterSettingModuleParameters

See Also