Sage Modeling and Simulation Library

Model Members

The Model type exposes the following members.

Constructors


  Name Description
Public method Model()()()()
Creates a model with a default name ('Model1', 'Model2', etc.) and self-declared Guid.
Public method Model(String)
Creates a model with a specified name, and self-declared Guid.
Public method Model(String, Guid)
Creates a model with a specified name and Guid.

Methods


  Name Description
Public method Abort
Aborts the model.
Public method AddError
Adds an error to the model, and iterates over all of the error handlers, allowing each in turn to respond to the error. As soon as any errorHandler indicates that it has HANDLED the error (by returning true from 'HandleError'), the error is cleared, and further handlers are not called.
Public method AddErrorCheckHandlerWithModelAbortOnFailure
Adds a handler that, after transition to a specified state, will check the model for errors and if it finds any, will abort the model, putting it back to idle.
Public method AddErrorHandler
Enables a user/developer to add an error handler to the model in real time, (e.g. during a simulation run) and ensures that that handler is called for any errors currently in existence in the model.
Public method AddModelObject
Public method AddService<(Of <<'(T>)>>)
Public method AddWarning
Adds a warning to this model, e.g. a 'GenericModelWarning'...
Public method ClearAllErrors
Removes all errors.
Public method ClearAllErrorsFor
Removes all errors whose target is the specified object.
Public method ClearAllWarnings
Clears all of the warnings applicable to this model.
Protected method CreateModelExecutive
Called during the creation of the model, this method creates the executive. It is intended to be overridden in derived classes if the designer wishes to create a new and different executive instead of the standard executive.
Protected method CreateStateMachine
Creates the state machine to be used by this model. Called by the framework, and intended to be overridden by a derived class.
Public method Dispose
Public method Equals(System.Object)
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected method Finalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Protected method FireModelCompletedEvent
Called by a derived class to cause this base class to fire the Model.Completed event.
Protected method FireModelStartingEvent
Called by a derived class to cause this base class to fire the Model.Starting event.
Protected method FireModelStoppingEvent
Called by a derived class to cause this base class to fire the Model.Stopping event.
Public method GetAbortEnum
Returns the enumeration that represents the resultant state of the ABORT transition in this model's state machine.
Public method GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public method GetIdleEnum
Returns the enumeration that represents the state of this model's state machine from which START is a legal transition.
Public method GetService<(Of <<'(T>)>>)
Public method GetStartEnum
Returns the enumeration that represents the resultant state of the START transition in this model's state machine.

NOTE:

This method, when added to a derived class, needs to ne 'new'ed, not overridden.
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method HasErrors
Returns true if the model has errors.
Public method HasWarnings
Returns true if this model has any active warnings.
Public method InitializeIdentity
Initializes the fields that feed the properties of this IModelObject identity.
Protected method MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public method OnNewResourceCreated
Must be called by the creator when a new resource is created.
Public method Pause
Pauses execution of this model after completion of the running callback of the current event.
Public method RemoveAutoclearedErrors
Removes ModelErrors whose 'AutoClear' value is set to true. Typically applied to errors that do not persist from run to run - i.e. that are run time, not configuration, errors.
Public method RemoveError
Removes the error from the model's collection of errors.
Public method RemoveErrorHandler
Removes an error handler from the model.
Public method Reset
Public method Resume
Resumes execution of this model. Ignored if the model is not already paused.
Public method Start
Starts the model.
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)

Fields


  Name Description
Protected field ErrorHandlers
Protected field Exec
The executive that this model is using.
Protected field m_errors

Properties


  Name Description
Public property Description
A description of this Model.
Public property Errors
An enumeration over all of the errors in the model.
Public property ErrorSummary
Provides a string that summarizes all of the errors currently active in this model.
Public property Executive
Provides access to the executive being used by this model.
Public property ExecutiveController
Gets the executive controller that governs the rate-throttling and frame-rendering event frequency of this model.
Public property Guid
The Guid by which this model will be known.
Public property IsCompleted
Gets or sets a value indicating whether this instance is completed.
Public property IsPaused
Gets or sets a value indicating whether this instance is paused.
Public property IsReady
Gets or sets a value indicating whether this instance is ready to be started.
Public property IsRunning
Gets or sets a value indicating whether this instance is running.
Public property ModelConfig
The ModelConfig is an object that holds the contents of the Sage® section of the app.config file.
Public property ModelObjects
A dictionary of currently live IModelObjects. An IModelObject that is garbage- collected is automatically removed from this collection. Note that the object is not necessarily removed at the time of last release, but at the time of garbage collection. Code can call Remove(...) to explicitly remove the object.
Public property Name
The name of this model.
Public property Parameters
Gets the parameters dictionary, a free-form dictionary of model-wide parameters.
Public property RandomSeed
Gets the random seed in use by this model.
Public property RandomServer
Gets the random server in use by this model.
Public property StateMachine
Provides access to the state machine being used by this model. While the state machine can be set, too, this is an advanced feature, and should not be done unless the developer is sure what they are doing.
Public property Warnings
An enumeration of all of the warnings currently applicable to this model.

Events


  Name Description
Public event Completed
Fired when the model has completed.
Public event ErrorCleared
Fired when an error is removed from a model.
Public event ErrorHappened
Fired when an error happens in (is added to) a model.
Public event Resetting
Fired when the model has been commanded to reset.
Public event ResourceCreatedEvent
Event that is fired when a new resource has been created.
Public event Starting
Fired when the model has been commanded to start. Should only be used to queue up events in the executive.
Public event Stopping
Fired when the model has been commanded to stop.
Public event WarningHappened
Fired when a warning is added to the model.