protected void updateTCellValues(float auxS, int iterationAPC) { if (Configuration.getKMax() * (auxS + Configuration.getS0()) > this.k) { this.k = Math.min((Configuration.getKMax() * (auxS + Configuration.getS0())), (this.k + Configuration.getKFi() * Configuration.getTimeAPC())); } else { this.k = Math.max((Configuration.getKMax() * (auxS + Configuration.getS0())), (this.k - Configuration.getKFi() * Configuration.getTimeAPC())); } if (Configuration.getPMax() * (auxS + Configuration.getS0()) > this.p) { this.p = Math.min((Configuration.getPMax() * (auxS + Configuration.getS0())), (this.p + Configuration.getPFi() * Configuration.getTimeAPC())); } else { this.p = Math.max((Configuration.getPMax() * (auxS + Configuration.getS0())), (this.p - Configuration.getPFi() * Configuration.getTimeAPC())); } //Escrever para ficheiro if (Configuration.isGraphicalMode()) { saveTCellGraphicFile(iterationAPC, auxS); } if(checkTerminationValues()){ if(isActivated()) inactivateTCell(iterationAPC); }else{ if(!isActivated()) activateTCell(); } } protected Boolean checkTerminationValues() { if (this.k < Configuration.getK0() && this.p < Configuration.getP0()) { return true; } return false; } protected Boolean isActivated() { if (this.tCellInactivateIteration != 0) return false; else return true; } protected Boolean isToKill(int currentAPC) { if (!isActivated()) { if ((currentAPC - tCellInactivateIteration) >= Configuration.getNumOfIterationsBeforeKill() ) { return true; } } return false; } protected void activateTCell() { tCellInactivateIteration = 0; } protected void inactivateTCell(int currentAPC) { tCellInactivateIteration = currentAPC; } protected void prepareTCelltoTest() { tCellInactivateIteration = 0; }