/// <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, ref object C, ref object D, ref object E, ref object F) { // <Custom code> 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.SimpleStep(GoalList); counter++; } A = PS.GetOutput(GoalList); B = counter; C = PS.GetAllMoves(GoalList); D = PS.GetAllWeightings(GoalList); E = PS.GetPositionArray(); var Names = new List <String> [PS.ParticleCount()]; for (int i = 0; i < PS.ParticleCount(); i++) { Names[i] = new List <String>(); } for (int i = 0; i < GoalList.Count; i++) { var FullName = GoalList[i].ToString(); Char splitter = '.'; var Name = FullName.Split(splitter); if (Name[0] != "KangarooSolver") { Name = FullName.Split('_', '+'); } var G = GoalList[i] as IGoal; for (int j = 0; j < G.PIndex.Count(); j++) { Names[G.PIndex[j]].Add(Name[2]); } } F = Names; // </Custom code> }