///<summary> ///zwraca penalty lub -1 gdy Hard Constraints nie są spełnione ///</summary> public virtual int checkConstraints(NurseClass[][][][] chromosomeVectorReference, PoolOfNurses obPoolOfNursesReference) { this.chromosomeVectorReference = chromosomeVectorReference; //uzupelniam referencje do Chromosoma //to trzeba przerzucic do konstruktora pozniej this.obPoolOfNursesReference = obPoolOfNursesReference; int howMuchHardConstraintsDone; int softConstraintPenalty = 0; howMuchHardConstraintsDone = checkHowMuchHardConstraintsIsDone(); if (howMuchHardConstraintsDone < 10)//jesli niespełnione hard constraints to już nie sprawdzam dalej { return(-1); } softConstraintPenalty = checkSoftConstraintsTemplateMethod(); return(softConstraintPenalty); }
public ChromosomeClass() { obPoolOfNurses = new PoolOfNurses(); init(); // wypelniam wektor losowymi wartosciami }