Esempio n. 1
0
        public override void ApplyMove(SimulationBox box, SimulationObject mcobject)
        {
            double dx = (2 * JobEngine.Rng.NextDouble() - 1) * Amplitude;
            double dy = (2 * JobEngine.Rng.NextDouble() - 1) * Amplitude;

            mcobject.X += dx;
            mcobject.Y += dy;
        }
Esempio n. 2
0
        public override double CalculateInteractionEnergy(SimulationObject Obj)
        {
            if (Obj is Circle circle)
            {
                if (circle.Radius + Radius
                    < Math.Sqrt((circle.X - X) * (circle.X - X)
                                + (circle.Y - Y) * (circle.Y - Y)))
                {
                    return(0);
                }
                else
                {
                    return(10000);
                }
            }

            throw new Exception("I don't know how to deal with this!!!");
        }
Esempio n. 3
0
 public abstract double CalculateInteractionEnergy(SimulationObject Obj);
Esempio n. 4
0
 public abstract void ApplyMove(SimulationBox box, SimulationObject mcobject);