示例#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;
        }
示例#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!!!");
        }
示例#3
0
 public abstract double CalculateInteractionEnergy(SimulationObject Obj);
 public abstract void ApplyMove(SimulationBox box, SimulationObject mcobject);