[This is preliminary documentation and is subject to change.]
Assembly: ClarionLibrary (in ClarionLibrary.dll) Version: 6.1.1.0 (6.1.1.0)
Syntax
C# |
---|
public class DriveParameters |
Remarks
This class contains all of the parameters that may be used by the Drive class. All classes that extend Drive 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" drives within the Clarion Library have been implemented. It is HIGHLY recommended that users defining their own (custom) drives follow this convention as well. Details on how to implement a parameters class for a custom drive can be found in the Advanced Tutorial under the Tutorials section of the Clarion Library package.
![]() |
---|
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. |
![]() |
---|
Global parameter settings are ONLY applicable prior to the initialization of an instance of a drive. During the initialization process, the global parameter settings are used to set the "default" values of the local parameters for a drive. Once initialized, the drive will only use the local parameters. Therefore, global parameter changes SHOULD ALWAYS be performed BEFORE instances of a drive are initialized. |
Copyright 2011. Nicholas Wilson
Examples

SomeDriveSubclass drive; // Elided code containing the initialization of drive using the <see cref="T:Clarion.AgentInitializer" /> drive.Parameters.BASELINE = 0; //Note that BASELINE is already 0 by default, so this doesn't actually change anything.

Drive.GlobalParameters.BASELINE = 0; // Elided code containing the initialization of particular Drive instances (as was demonstrated above)

SomeDriveSubclass.GlobalParameters.BASELINE = 0; // Elided code containing the initialization of particular Drive instances (as was demonstrated above)
![]() |
---|
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 Drive 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 Drive called "SomeOtherDrive" whose parameters class extends DriveParameters but does not override BASELINE. In this case, performing the following global parameter change:![]() SomeOtherDrive.GlobalParameters.BASELINE = 0; ![]() Drive.GlobalParameters.BASELINE = 0; Keep this in mind when you are performing global parameter changes as it could cause unintended consequences during runtime. For the "built-in" drives 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 drive. As a general rule of thumb (when creating a custom drive), if your drive makes use of a parameter that was defined in a base class of that drive, then you should override that parameter in your drive's parameters class. This will allow users of your drive to globally change that parameter at either the base class level or the level of your drive. Details on how to correctly implement this can be found in the Advanced Tutorial under the Tutorials section of the Clarion Library package. |
Inheritance Hierarchy
Clarion.Framework.Templates..::..Drive..::..DriveParameters
Clarion.Framework..::..AffiliationBelongingnessDrive..::..AffiliationBelongingnessDriveParameters
Clarion.Framework..::..AutonomyDrive..::..AutonomyDriveParameters
Clarion.Framework..::..AvoidingPhysicalDangerDrive..::..AvoidingPhysicalDangerDriveParameters
Clarion.Framework..::..AvoidingUnpleasantStimuliDrive..::..AvoidingUnpleasantStimuliDriveParameters
Clarion.Framework..::..ConservationDrive..::..ConservationDriveParameters
Clarion.Framework..::..CuriosityDrive..::..CuriosityDriveParameters
Clarion.Framework..::..DeferenceDrive..::..DeferenceDriveParameters
Clarion.Framework..::..DominancePowerDrive..::..DominancePowerDriveParameters
Clarion.Framework..::..FairnessDrive..::..FairnessDriveParameters
Clarion.Framework..::..FoodDrive..::..FoodDriveParameters
Clarion.Framework..::..HonorDrive..::..HonorDriveParameters
Clarion.Framework..::..NurturanceDrive..::..NurturanceDriveParameters
Clarion.Framework..::..RecognitionAchievementDrive..::..RecognitionAchievementDriveParameters
Clarion.Framework..::..ReproductionDrive..::..ReproductionDriveParameters
Clarion.Framework..::..RestDrive..::..RestDriveParameters
Clarion.Framework..::..SimilanceDrive..::..SimilanceDriveParameters
Clarion.Framework..::..WaterDrive..::..WaterDriveParameters