Collapse All Expand All

C#

Clarion Library 6.1.1
AgentInitializer..::..InitializeDriveComponent<(Of <(<'T>)>)> Method
AgentInitializer Class Example See Also Send Feedback

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

Initializes an ImplicitComponent to be used inside of a Drive (upon being committed)

Namespace: Clarion
Assembly: ClarionLibrary (in ClarionLibrary.dll) Version: 6.1.1.0 (6.1.1.0)

# Syntax

C#
    public static T InitializeDriveComponent<T>(
    	Drive destination,
    	IimplicitComponentFactory<T> factory,
    	params Object[] parameters
    )
    where T : ImplicitComponent

#### Parameters

destination
  Type: Clarion.Framework.Templates..::..Drive
  The drive in which the component is being attached

factory
  Type: Clarion.Framework.Templates..::..IimplicitComponentFactory<(Of <(<'T>)>)>
  The factory to use to generate the component

parameters
  Type: array<System..::..Object>[]()[][]
  (optional) Any parameters that may be needed by the factory in order to initialize the component.
  To find-out the list of required and optional parameters, please consult the documentation of the factory for the component being generated

# Type Parameters

T
  The type of ImplicitComponent that is to be initialized within the drive

#### Return Value

A component of the type specified initialized within the drive specified

# Remarks

The output layer of the ImplicitComponent returned by this method will already be setup for the specified drive. In other words, the "Drive Strength" dimension-value pair associated with this drive will automatically be added to the output layer by this method. Therefore, in order to complete the initialization process, you only need to specify the input layer of the component before committing it to the drive.

Caution
Don't forget that the component being initialized by this method MUST be committed to the drive in which it was initialized! Failure to do so WILL result in an error!

# Examples

CopyC#

    FoodDrive foodDrive = AgentInitializer.InitializeDrive(John, FoodDrive.Factory, .5);

    BPNetwork comp = AgentInitializer.InitializeDriveComponent(foodDrive, BPNetwork.Factory);

    //Elided code further initializing the drive and drive component

    foodDrive.Commit(comp);

    John.Commit(foodDrive);

# See Also

AgentInitializer Class
Clarion Namespace