Search Results for

    Show / Hide Table of Contents

    Class ParticleFactory

    Factory for instantiating Particles with specific ParticleAlgorithm implementations attached to them.

    To be called by ParticleSystem to initialize the simulation.

    Inheritance
    object
    ParticleFactory
    Namespace: AS2.Sim
    Assembly: .dll
    Syntax
    public class ParticleFactory

    Methods

    | Edit this page View Source

    CreateParticle(ParticleSystem, string, InitializationParticle, bool)

    Creates a new particle for the specified algorithm using the given InitializationParticle as a template.

    Declaration
    public static Particle CreateParticle(ParticleSystem system, string algorithmId, InitializationParticle ip, bool initialize = false)
    Parameters
    Type Name Description
    ParticleSystem system

    The system to which the particle will belong.

    string algorithmId

    The ID name of the algorithm that will control the particle's behavior.

    InitializationParticle ip

    The InitializationParticle that should be used as a template to copy the position, expansion state, chirality, compass direction and algorithm parameters from.

    bool initialize

    If true, call the algorithm's Init method with the parameters stored in ip.

    Returns
    Type Description
    Particle
    | Edit this page View Source

    CreateParticle(ParticleSystem, string, Vector2Int, Direction, bool, Direction)

    Creates a new particle for the specified algorithm.

    Declaration
    public static Particle CreateParticle(ParticleSystem system, string algorithmId, Vector2Int position, Direction compassDir = Direction.NONE, bool chirality = true, Direction headDir = Direction.NONE)
    Parameters
    Type Name Description
    ParticleSystem system

    The system to which the particle will belong.

    string algorithmId

    The ID name of the algorithm that will control the particle's behavior.

    Vector2Int position

    The grid position of the particle's tail.

    Direction compassDir

    The global direction representing the particle's compass, i.e., the direction it believes to be E.

    bool chirality

    If true, the particle has the same counter-clockwise positive rotation direction as the global coordinate system, otherwise it is inverted.

    Direction headDir

    The global direction of the particle's head if it should be expanded.

    Returns
    Type Description
    Particle

    A new particle with an attached algorithm instance.

    • Edit this page
    • View Source
    In this article
    Back to top AmoebotSim 2.0 Documentation v1.11
    Copyright © 2025 AmoebotSim 2.0 Authors
    Generated by DocFX