public static void Main (String[] args, ILog logger) { int n = 10000; if (args.Length > 0) n = Int32.Parse (args [0]); NBodySystem bodies = new NBodySystem (); logger.InfoFormat ("{0:f9}", bodies.Energy ()); for (int i = 0; i < n; i++) bodies.Advance (0.01); logger.InfoFormat ("{0:f9}", bodies.Energy ()); }
public static void Main(String[] args, ILog logger) { int n = 10000; if (args.Length > 0) { n = Int32.Parse(args [0]); } NBodySystem bodies = new NBodySystem(); logger.InfoFormat("{0:f9}", bodies.Energy()); for (int i = 0; i < n; i++) { bodies.Advance(0.01); } logger.InfoFormat("{0:f9}", bodies.Energy()); }