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