Class UniversalReconfigurationInitializer
Initialization method for the Universal Reconfiguration algorithm. Generates a random connected structure with holes and allows starting from any phase.
Namespace: AS2.Algos.Reconfiguration
Assembly: .dll
Syntax
public class UniversalReconfigurationInitializer : InitializationMethod
Constructors
| Edit this page View SourceUniversalReconfigurationInitializer(ParticleSystem)
Declaration
public UniversalReconfigurationInitializer(ParticleSystem system)
Parameters
| Type | Name | Description |
|---|---|---|
| ParticleSystem | system |
Methods
| Edit this page View SourceGenerate(int, float, StartState, bool)
Generates a random configuration with the specified number of particles according to the given starting state, then sets the starting phase on the root particle.
Declaration
public void Generate(int numParticles = 42, float holeProb = 0.3, UniversalReconfigurationInitializer.StartState startState = StartState.ARBITRARY, bool markAllConflictsToBound = false)
Parameters
| Type | Name | Description |
|---|---|---|
| int | numParticles | Number of particles to generate (default: 25). |
| float | holeProb | Probability of a hole at each lattice position (default: 0.3).
Only used when |
| UniversalReconfigurationInitializer.StartState | startState | The state to start the algorithm in (default: ARBITRARY). |
| bool | markAllConflictsToBound | If true, all conflicts in the first phase are marked yellow. |
GenerateBounded(int, float, Chirality, Compass)
Generates a random connected structure where every non-empty row has at least ⌈√n⌉ particles (the "bounded" condition). First generates a random structure with holes, then iteratively merges rows that are too small into adjacent rows. When both rows have a particle in the same column, one is randomly moved to extend the target row (append/prepend).
Declaration
private void GenerateBounded(int numParticles, float holeProb, Initialization.Chirality chirality, Initialization.Compass compassDir)
Parameters
| Type | Name | Description |
|---|---|---|
| int | numParticles | The number of particles to place. |
| float | holeProb | Probability of leaving a position empty (hole). |
| Initialization.Chirality | chirality | The chirality setting for all particles. |
| Initialization.Compass | compassDir | The compass setting for all particles. |
GenerateYMonotone(int, Chirality, Compass, bool)
Generates a y-monotone structure with the given number of particles. A y-monotone structure consists of columns of particles stacked contiguously (no gaps within a column). Columns are built left to right, each with a random height and a starting y-level chosen to guarantee connectivity with the previous column.
Declaration
private void GenerateYMonotone(int numParticles, Initialization.Chirality chirality, Initialization.Compass compassDir, bool histogram = false)
Parameters
| Type | Name | Description |
|---|---|---|
| int | numParticles | The number of particles to place. |
| Initialization.Chirality | chirality | The chirality setting for all particles. |
| Initialization.Compass | compassDir | The compass setting for all particles. |
| bool | histogram | If true, all columns start at y=0 (for a histogram structures). |