Show / Hide Table of Contents

Class Parallel

A component that can execute multiple behaviors created by IEntity instances in parallel.

Inheritance
object
ParameterSet
ParameterSetCollection
Entity
Entity<Parameters>
Parallel
Implements
IParameterized<Parameters>
IEntity
IParameterSetCollection
IParameterSet
ICloneable<IEntity>
IRuleSubject
Inherited Members
Entity<Parameters>.Parameters
Entity<Parameters>.Clone()
Entity.LinkParameters
Entity.Name
Entity.SetParameter<P>(string, P)
Entity.ToString()
ParameterSetCollection.GetParameterSet<P>()
ParameterSetCollection.TryGetParameterSet<P>(out P)
ParameterSetCollection.ParameterSets
ParameterSetCollection.TrySetParameter<P>(string, P)
ParameterSetCollection.GetProperty<P>(string)
ParameterSetCollection.TryGetProperty<P>(string, out P)
ParameterSetCollection.CreateParameterSetter<P>(string)
ParameterSetCollection.CreatePropertyGetter<P>(string)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
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 name is null.

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 name is null.

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 name is null.

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
Entity.CreateBehaviors(ISimulation)
Exceptions
Type Condition
ArgumentNullException

Thrown if simulation is null.

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.

Implements

IParameterized<P>
IEntity
IParameterSetCollection
IParameterSet
ICloneable<T>
IRuleSubject

Extension Methods

Utility.ThrowIfNull<T>(T, string)
Documentation.ParameterValues<T>(IParameterSet, bool)
Documentation.Parameters(IParameterSet)
Documentation.ParameterValues<T>(IParameterSetCollection, bool)
Documentation.Parameters(IParameterSetCollection)

See Also

Entity
IComponent
IParameterized<P>
Parameters
In this article
Back to top Generated by DocFX