Sage Modeling and Simulation Library

Resource Constructor (IModel, String, Guid, Double, Double, Boolean, Boolean, Boolean, IResource)

Creates a new Resource, wrapped by an implementer of IResource. This constructor is used if the resource being created is serving as a delegated-to token which represents some other resource. A resource is created with a capacity, and is granted in portions of that capacity, or if atomic, all-or-nothing. The IResourceRequest will specify a desired amount. If the IResourceRequest specifies a desired quantity less than the resource's capacity, and the resource is atomic, the IResourceRequest will be granted the full capacity of the resource. A self-managing resource is a resource that is responsible for granting access to itself.

Namespace:  Highpoint.Sage.Resources
Assembly:  Sage4 (in Sage4.dll)

Syntax


public Resource(
	IModel model,
	string name,
	Guid guid,
	double capacity,
	double availability,
	bool isAtomic,
	bool isDiscrete,
	bool isPersistent,
	IResource wrappedByWhom
)

Parameters

model
Type: Highpoint.Sage.SimCore..::..IModel
The model to which the Resource will belong.
name
Type: String
The name of the Resource.
guid
Type: Guid
The guid of the Resource.
capacity
Type: Double
The capacity of the Resource. How much there is to be granted.
availability
Type: Double
The initial available quantity of the resource.
isAtomic
Type: Boolean
True if the Resource is atomic. Atomicity infers that the resource is granted all-or-nothing.
isDiscrete
Type: Boolean
True if the Resource is discrete. Discreteness infers that the resource is granted in unitary amounts.
isPersistent
Type: Boolean
True if the Resource is persistent. Atomicity infers that the resource, once granted, must be returned to the pool.
wrappedByWhom
Type: Highpoint.Sage.Resources..::..IResource
A reference to the outer object which this instance exists to represent.