Class Entity
Base class for any circuit object that can take part in simulations.
Inherited Members
Namespace: SpiceSharp.Entities
Assembly: SpiceSharp.dll
Syntax
public abstract class Entity : ParameterSetCollection, IEntity, IParameterSetCollection, IParameterSet, ICloneable<IEntity>
Constructors
Entity(string)
Initializes a new instance of the Entity class.
Declaration
protected Entity(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the entity. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
Properties
LinkParameters
Gets or sets a value indicating whether the parameters should reference that of the entity. If the parameters are not referenced, then the parameters are cloned instead.
Declaration
public bool LinkParameters { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Name
Gets the name of the entity.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string | The name. |
Methods
Clone()
Clones the instance.
Declaration
public abstract IEntity Clone()
Returns
| Type | Description |
|---|---|
| IEntity | The cloned instance. |
CreateBehaviors(ISimulation)
Creates the behaviors and stores them in the specified container.
Declaration
public abstract void CreateBehaviors(ISimulation simulation)
Parameters
| Type | Name | Description |
|---|---|---|
| ISimulation | simulation | The simulation. |
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. |
SetParameter<P>(string, P)
Sets the value of a parameter of the specified type and with the specified name. This is just a wrapper that allows chaining these commands.
Declaration
public Entity SetParameter<P>(string name, P value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the parameter. |
| P | value | The value of the parameter. |
Returns
| Type | Description |
|---|---|
| Entity | The entity. |
Type Parameters
| Name | Description |
|---|---|
| P | The parameter value type. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
| ParameterNotFoundException | Thrown if the parameter was not found. |
ToString()
Returns a string that represents the current entity.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |