Class UnrollingTestInitializer
Namespace: AS2.Algos.SuboracleTest
Assembly: .dll
Syntax
public class UnrollingTestInitializer : InitializationMethod
Constructors
| Edit this page View SourceUnrollingTestInitializer(ParticleSystem)
Declaration
public UnrollingTestInitializer(ParticleSystem system)
Parameters
| Type | Name | Description |
|---|---|---|
| ParticleSystem | system |
Methods
| Edit this page View SourceDrawSpiralFromString(Vector2Int, Direction, bool, string)
Helper function to draw a spiral based on a string input, where the numbers indicate the length of each segment and the direction changes after each segment.
Declaration
private (Direction, List<Vector2Int>) DrawSpiralFromString(Vector2Int startPos, Direction mainDir, bool clockwise, string spiral)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2Int | startPos | The starting position of the spiral |
| Direction | mainDir | The starting direction of the spiral |
| bool | clockwise | Whether the spiral should be clockwise or counterclockwise |
| string | spiral | The string representing the spiral |
Returns
| Type | Description |
|---|---|
| (Direction, List<Vector2Int>) | A tuple containing the final direction and the list of generated positions |
Generate(int, int, CardinalDirection, bool, float, bool, string)
Declaration
public void Generate(int unrollCount = 0, int numParticles = 100, UnrollingTestInitializer.CardinalDirection startDir = CardinalDirection.E, bool clockwise = true, float turnProb = 0.35, bool allowAcute = false, string segmentLengths = "")
Parameters
| Type | Name | Description |
|---|---|---|
| int | unrollCount | |
| int | numParticles | |
| UnrollingTestInitializer.CardinalDirection | startDir | |
| bool | clockwise | |
| float | turnProb | |
| bool | allowAcute | |
| string | segmentLengths |
GenerateSpiralPositions(Vector2Int, Direction, int, bool, float, bool)
Helper function to generate a spiral randomly based on the specified parameters
Declaration
private (Direction, List<Vector2Int>) GenerateSpiralPositions(Vector2Int startPos, Direction mainDir, int numPositions, bool clockwise, float turnProb, bool allowAcute)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2Int | startPos | The starting position of the spiral |
| Direction | mainDir | The starting direction of the spiral |
| int | numPositions | The number of positions to generate |
| bool | clockwise | Whether the spiral should be clockwise or counterclockwise |
| float | turnProb | The probability of turning |
| bool | allowAcute | Whether to allow acute turns |
Returns
| Type | Description |
|---|---|
| (Direction, List<Vector2Int>) | A tuple containing the final direction and the list of generated positions |