public BasicForceStrategy(Molecula[] moleculas, ForceCalculatingService forceCalculatingService, MoleculasUpdatingService moleculasUpdatingService) { _moleculas = moleculas; _forceCalculatingService = forceCalculatingService; _moleculasUpdatingService = moleculasUpdatingService; _forces = new Vector2[moleculas.Length][]; for (int i = 0; i < moleculas.Length; i++) { _forces[i] = new Vector2[moleculas.Length]; } }
public ParallelForceStratagy(Molecula[] moleculas, ForceCalculatingService forceCalculatingService, MoleculasUpdatingService moleculasUpdatingService, int threadCount) { _moleculas = moleculas; _forceCalculatingService = forceCalculatingService; _moleculasUpdatingService = moleculasUpdatingService; _threadCount = threadCount; _barrier = new Barrier(_threadCount); _forces = new Vector2[moleculas.Length][]; for (int i = 0; i < moleculas.Length; i++) { _forces[i] = new Vector2[moleculas.Length]; } }
public BaseForceStrategy GetBasicForceStrategy(Molecula[] moleculas, ForceCalculatingService forceCalculatingService, MoleculasUpdatingService moleculasUpdatingService) { return new BasicForceStrategy(moleculas, forceCalculatingService, moleculasUpdatingService); }
public BaseForceStrategy GetParallelForceStratagy(Molecula[] moleculas, ForceCalculatingService forceCalculatingService, MoleculasUpdatingService moleculasUpdatingService, int threadCount) { return new ParallelForceStratagy(moleculas, forceCalculatingService, moleculasUpdatingService, threadCount); }