Example #1
0
        public IVelocy Add(IVelocy speed)
        {
            Velocy v = (speed as Velocy);

            int[] vel = new int[this.velocy.Length];
            for (int i = 0; i < this.velocy.Length; i++)
            {
                vel[i] = (this.velocy[i] + v.velocy[i]) % this.numberOfWorkers;
            }

            return(new Velocy(this.numberOfWorkers, vel));
        }
Example #2
0
        public IPositionPS AddVelocy(IVelocy velocy)
        {
            Velocy v = (velocy as Velocy);

            int[] vec    = v.GetVelocy();
            int[] outPos = new int[this.position.Length];
            for (int i = 0; i < this.position.Length; i++)
            {
                outPos[i] = (this.position[i] + vec[i]) % this.numberOfWorkers;
                if (outPos[i] < 0)
                {
                    outPos[i] *= (-1);
                }
            }

            return(new PositionPS(outPos, this.numberOfWorkers));
        }
Example #3
0
 public SolutionPosSpeed(IPositionPS position, IVelocy velocy)
 {
     this.Position = position;
     this.Speed    = velocy;
 }