Class SysPin
System-side implementation of the abstract base class Pin, which declares the API for the developer.
Namespace: AS2.Sim
Assembly: .dll
Syntax
public class SysPin : Pin
Constructors
| Edit this page View SourceSysPin(SysPartitionSet, int, Direction, int, bool, int, int)
Declaration
public SysPin(SysPartitionSet partitionSet, int id, Direction localDir, int globalLabel, bool head, int localEdgeOffset, int globalEdgeOffset)
Parameters
Type | Name | Description |
---|---|---|
SysPartitionSet | partitionSet | |
int | id | |
Direction | localDir | |
int | globalLabel | |
bool | head | |
int | localEdgeOffset | |
int | globalEdgeOffset |
Fields
| Edit this page View SourceglobalEdgeOffset
The index of the pin on its edge relative to the global counter-clockwise direction.
Declaration
public int globalEdgeOffset
Field Value
Type | Description |
---|---|
int |
globalLabel
The global label of the edge on which this pin lies.
Declaration
public int globalLabel
Field Value
Type | Description |
---|---|
int |
head
Indicates whether the pin lies on the particle's head.
Declaration
public bool head
Field Value
Type | Description |
---|---|
bool |
id
The unique ID within the pin configuration.
Declaration
public int id
Field Value
Type | Description |
---|---|
int |
localDir
The local direction of the edge on which this pin lies.
Declaration
public Direction localDir
Field Value
Type | Description |
---|---|
Direction |
localEdgeOffset
The index of the pin on its edge relative to the particle's chirality.
Declaration
public int localEdgeOffset
Field Value
Type | Description |
---|---|
int |
partitionSet
The partition set to which this pin belongs.
Declaration
public SysPartitionSet partitionSet
Field Value
Type | Description |
---|---|
SysPartitionSet |
Properties
| Edit this page View SourceDirection
The local direction of the edge on which this pin is located.
Declaration
public override Direction Direction { get; }
Property Value
Type | Description |
---|---|
Direction |
Overrides
| Edit this page View SourceId
The ID of this pin.
Declaration
public override int Id { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
| Edit this page View SourceIsOnHead
Whether the edge this pin belongs to is on the particle's head.
See also IsOnTail.
Declaration
public override bool IsOnHead { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceIsOnTail
Whether the edge this pin belongs to is on the particle's tail.
See also IsOnHead.
Declaration
public override bool IsOnTail { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceOffset
The offset of this pin on its edge.
The pins on an edge are ordered according to the chirality of
the particle. Their offsets range from 0
to
PinsPerEdge - 1
.
Declaration
public override int Offset { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
| Edit this page View SourcePartitionSet
The partition set to which this pin currently belongs.
Declaration
public override PartitionSet PartitionSet { get; }
Property Value
Type | Description |
---|---|
PartitionSet |
Overrides
Methods
| Edit this page View SourceGetReceivedMessage()
Returns the message this pin has received in the last round, if it has received one and it belongs to the current pin configuration.
Declaration
public override Message GetReceivedMessage()
Returns
Type | Description |
---|---|
Message | The message received by this pin in the
last round, if it exists, otherwise |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if this pin does not belong to the current pin configuration. |
HasReceivedMessage()
Checks whether this pin has received a message in the last round, if the pin configuration it belongs to is the current one.
Declaration
public override bool HasReceivedMessage()
Returns
Type | Description |
---|---|
bool |
|
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if this pin does not belong to the current pin configuration. |
Print()
Declaration
public string Print()
Returns
Type | Description |
---|---|
string |
ReceivedBeep()
Checks whether this pin has received a beep in the last round, if the pin configuration it belongs to is the current one.
Declaration
public override bool ReceivedBeep()
Returns
Type | Description |
---|---|
bool |
|
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if this pin does not belong to the current pin configuration. |
SendBeep()
Sends a beep on this pin if the pin configuration it belongs to is the next one.
Declaration
public override void SendBeep()
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if this pin does not belong to the next pin configuration. |
SendMessage(Message)
Sends a message on this pin if the pin configuration it belongs to is the next one.
Declaration
public override void SendMessage(Message msg)
Parameters
Type | Name | Description |
---|---|---|
Message | msg | The message to be sent. |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if this pin does not belong to the next pin configuration. |