public AgentPlaneSystem(List <Point3d> P, List <Vector3d> V) { // build agent planes array agentPlanes = new AgentPlane[P.Count]; this.MaxSpeed = 0.1; Parallel.For(0, P.Count, i => { agentPlanes[i] = new AgentPlane(P[i], V[i], this); }); }
// .......................... methods public void Build(Point3d[] P, Vector3d[] V) { // build agent planes array agentPlanes = new AgentPlane[P.Length]; // populate agent planes array Parallel.For(0, P.Length, i => { agentPlanes[i] = new AgentPlane(P[i], V[i], this); }); }
// .......................... constructor public AgentPlaneSystem(List <Point3d> P, List <Vector3d> V, double pR, double cI, double aI, double sI, double fI, double mF) { this.PlaneRadius = pR; this.CohesionStrength = cI; this.AlignmentStrength = aI; this.SeparationStrength = sI; this.FieldStrength = fI; this.MaxForce = mF; this.MaxSpeed = 0.3; // build agent planes array agentPlanes = new AgentPlane[P.Count]; Parallel.For(0, P.Count, i => { agentPlanes[i] = new AgentPlane(P[i], V[i], this); }); }