Пример #1
0
    public void Step(int dDays)
    {
        // step for System

        // step for each PS
        foreach (var PS in planetSystems)
        {
            PS.Step(dDays);
        }
    }
    /// <summary>
    /// This procedure contains the user code. Input parameters are provided as regular arguments,
    /// Output parameters as ref arguments. You don't have to assign output parameters,
    /// they will have a default value.
    /// </summary>
    private void RunScript(List <object> Goals, bool Reset, bool Step, ref object A, ref object B)
    {
        if (Reset)
        {
            PS      = new KangarooSolver.PhysicalSystem();
            counter = 0;
            GoalList.Clear();
            foreach (IGoal G in Goals)      //Assign indexes to the particles in each Goal:
            {
                PS.AssignPIndex(G, 0.0001); // the second argument is the tolerance distance below which points combine into a single particle
                GoalList.Add(G);
            }
        }
        if (Step)
        {
            PS.Step(GoalList, true, 1);
            counter++;
        }

        A = PS.GetOutput(GoalList);
        B = counter;
    }