Class Rule3abc
Implements rules 3a, 3b, and 3c of the MonotoneToLine algorithm.
These rules handle columns where a single particle holds both the left and right line bonds. The representative expands, performs a handover with a neighbor followed by a contraction to redistribute the line bonds to adjacent particles. Rule 3a: neighbors above and below Rule 3b: only neighbors above, uneven column count Rule 3c: only neighbors below, uneven column count
Namespace: AS2.Suboracles.Reconfiguration
Assembly: .dll
Syntax
public class Rule3abc : Suboracle<Rule3abc>
Constructors
| Edit this page View SourceRule3abc(Particle)
Declaration
public Rule3abc(Particle rep)
Parameters
| Type | Name | Description |
|---|---|---|
| Particle | rep |
Fields
| Edit this page View Sourcec
Declaration
private ParticleAttribute<bool> c
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<Rule3abc>, bool, Direction, Direction)
Initializes the suboracle for a new run.
Declaration
public void Init(List<Rule3abc> memberParticles, bool c, Direction xDir = Direction.E, Direction yDir = Direction.NNE)
Parameters
| Type | Name | Description |
|---|---|---|
| List<Rule3abc> | memberParticles | The particles that are part of this suboracle instance. |
| bool | c | True if rule 3c (handover with neighbor below), false if rules 3a/3b (handover with neighbor above). |
| 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: Releases bonds and expands the representative. Round 1: Performs a handover with the neighbor in the y-direction. Round 2: Contracts the neighbor and cleans up bonds.
Declaration
protected override bool OnActivate()
Returns
| Type | Description |
|---|---|
| bool | True if the rule is complete, false otherwise. |