Exemple #1
0
 public SimpleDynamicSituationFactory(Structure2D structure, IParticleFactory particlesFactory, List <IDecidable> decisionMakers, float executionTime)
 {
     this.structure        = structure;
     this.particlesFactory = particlesFactory;
     this.decisionMakers   = decisionMakers;
     this.executionTime    = executionTime;
 }
        public List <Particle2D> CreateParticles(Structure2D structure, List <IDecidable> decisionMakers)
        {
            if (decisionMakers.Count != particlesPositions.Count)
            {
                throw new Exception("Particles position count must match delta Time count");
            }

            List <Particle2D> newParticles = new List <Particle2D>();

            if (dts == null)
            {
                for (int i = 0; i < particlesPositions.Count; i++)
                {
                    newParticles.Add(new Walker2D(i, structure, decisionMakers[i], particlesPositions[i]));
                }
            }
            else
            {
                for (int i = 0; i < particlesPositions.Count; i++)
                {
                    newParticles.Add(new Walker2D(i, structure, decisionMakers[i], particlesPositions[i], dts[i]));
                }
            }

            return(newParticles);
        }
Exemple #3
0
        public TheoricalSituation(DynamicManager2D dynamicManager, Structure2D structure, List <IDecidable> decisionMakers, List <Particle2D> particles, float executionTime)
        {
            this.dynamicManager = dynamicManager;
            this.structure      = structure;
            this.decisionMakers = decisionMakers;
            this.particles      = particles;
            this.executionTime  = executionTime;

            setup();
        }
Exemple #4
0
        public Walker2D(int elementIDNumber, Structure2D structure, IDecidable decisionMaker, Position position = new Position(), float dt = 1)
        {
            elementID = new ID {
                type = ElementType.Particle, number = elementIDNumber
            };
            this.structure     = structure;
            this.decisionMaker = decisionMaker;

            this.position = position;

            this.dt = dt;
        }
        public TheoricalWalker(DynamicManager2D dynamicManager, int elementIDNumber, Structure2D structure, IDecidable decisionMaker, double probability, Position position = new Position(), float dt = 1)
        {
            elementID = new ID {
                type = ElementType.Particle, number = elementIDNumber
            };

            this.dynamicManager = dynamicManager;
            this.structure      = structure;
            this.decisionMaker  = decisionMaker;

            this.probability = probability;

            this.position = position;

            this.dt = dt;
        }
Exemple #6
0
 public Particle2D generate(int elementIDNumber, Structure2D structure, IDecidable decisionMaker, Position position = new Position(), float dt = 1)
 {
     return(new Walker2D(elementIDNumber, structure, decisionMaker, position, dt));
 }