Class Parallel
A component that can execute multiple behaviors created by IEntity instances in parallel.
Implements
Inherited Members
Namespace: SpiceSharp.Components
Assembly: SpiceSharp.dll
Syntax
public class Parallel : Entity<Parameters>, IParameterized<Parameters>, IEntity, IParameterSetCollection, IParameterSet, ICloneable<IEntity>, IRuleSubject
Remarks
Running entity behaviors in parallel requires shared resources to be locked. Running entities in parallel are not a good idea if the entities spend a lot of time accessing these shared resources compared to the time they spend actually computing. Especially since there is also some overhead in setting up these resources and structures for executing behaviors in parallel.
It is possible to combine entities into a Subcircuit first, and having them use a local solver. This keeps the shared resources very limited, allowing each subcircuit to do its work without interference from read-write locking. This option is very advantageous if the subcircuits are large, but have only a few voltage nodes common with the outside.
Constructors
Parallel(string)
Initializes a new instance of the Parallel class.
Declaration
public Parallel(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the component. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
Parallel(string, params IEntity[])
Initializes a new instance of the Parallel class.
Declaration
public Parallel(string name, params IEntity[] entities)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the component. |
IEntity[] | entities | The components that can be executed in parallel. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
Parallel(string, IEnumerable<IEntity>)
Initializes a new instance of the Parallel class.
Declaration
public Parallel(string name, IEnumerable<IEntity> entities)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the component. |
IEnumerable<IEntity> | entities | The components that can be executed in parallel. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
Methods
Apply(IRules)
Applies the subject to any rules in the validation provider.
Declaration
public void Apply(IRules rules)
Parameters
Type | Name | Description |
---|---|---|
IRules | rules | The provider. |
CreateBehaviors(ISimulation)
Creates the behaviors and stores them in the specified container.
Declaration
public override void CreateBehaviors(ISimulation simulation)
Parameters
Type | Name | Description |
---|---|---|
ISimulation | simulation | The simulation. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ArgumentException | Thrown if the simulation does not use an IComplexSimulationState. |
TypeNotFoundException | Thrown if a required behavior or parameter set could not be found. |
AmbiguousTypeException | Thrown if a behavior or parameter set could not be resolved unambiguously. |