Class Rule3de
Implements rules 3d and 3e of the MonotoneToLine algorithm.
These rules handle columns with an even number of particles where a single particle holds both the left and right line bonds. Every second particle expands, performs a handover with its neighbor, and then contracts to create two columns with half the particles each. Rule 3d: the bond-holding particle has a neighbor above. Rule 3e: the bond-holding particle has a neighbor below.
Namespace: AS2.Suboracles.Reconfiguration
Assembly: .dll
Syntax
public class Rule3de : Suboracle<Rule3de>
Constructors
| Edit this page View SourceRule3de(Particle)
Declaration
public Rule3de(Particle rep)
Parameters
| Type | Name | Description |
|---|---|---|
| Particle | rep |
Fields
| Edit this page View Sourced
Declaration
private ParticleAttribute<bool> d
Field Value
| Type | Description |
|---|---|
| ParticleAttribute<bool> |
round
Declaration
private ParticleAttribute<int> round
Field Value
| Type | Description |
|---|---|
| ParticleAttribute<int> |
xDir
Declaration
private Direction xDir
Field Value
| Type | Description |
|---|---|
| Direction |
yDir
Declaration
private Direction yDir
Field Value
| Type | Description |
|---|---|
| Direction |
Methods
| Edit this page View SourceInit(List<Rule3de>, bool, Direction, Direction)
Initializes the suboracle for a new run.
Declaration
public void Init(List<Rule3de> memberParticles, bool d, Direction xDir = Direction.E, Direction yDir = Direction.NNE)
Parameters
| Type | Name | Description |
|---|---|---|
| List<Rule3de> | memberParticles | The particles that are part of this suboracle instance. |
| bool | d | True if rule 3d (neighbor above), false if rule 3e (neighbor below). |
| Direction | xDir | The direction of the x-axis. |
| Direction | yDir | The direction of the y-axis. |
OnActivate()
Executes the next round of the rule. Round 0: Every second particle expands Round 1: Expanded particles perform a handover with their contracted neighbors. Round 2: Bonds are released and the expanded particles contract.
Declaration
protected override bool OnActivate()
Returns
| Type | Description |
|---|---|
| bool | True if the rule is complete, false otherwise. |