Examples of applyPenalty()


Examples of fr.neatmonster.nocheatplus.utilities.PenaltyTime.applyPenalty()

 
  @Test
  public void testZeroSequence() {
    long now = System.currentTimeMillis();
    PenaltyTime pt = new PenaltyTime();
    pt.applyPenalty(now, 0);
    if (pt.isPenalty(now )) {
      fail("Expect no penalty with duration 0.");
    }
  }
 
View Full Code Here

Examples of fr.neatmonster.nocheatplus.utilities.PenaltyTime.applyPenalty()

      long j = i % 100;
      if (j == 0) {
        if (pt.isPenalty(now + i)) {
          fail("Expect no penalty at i=" + i);
        }
        pt.applyPenalty(now + i, 50);
      } else if (j < 50) {
        if (!pt.isPenalty(now + i)) {
          fail("Expect penalty at i=" + i);
        }
      } else {
View Full Code Here

Examples of fr.neatmonster.nocheatplus.utilities.PenaltyTime.applyPenalty()

 
  @Test
  public void testReset() {
    long now = System.currentTimeMillis();
    PenaltyTime pt = new PenaltyTime();
    pt.applyPenalty(now, 73);
    if (pt.isPenalty(now - 1)) {
      fail("isPenalty should return false on past time.");
    }
    pt.applyPenalty(now - 1, 73);
    if (pt.isPenalty(now + 72)) {
View Full Code Here

Examples of fr.neatmonster.nocheatplus.utilities.PenaltyTime.applyPenalty()

    PenaltyTime pt = new PenaltyTime();
    pt.applyPenalty(now, 73);
    if (pt.isPenalty(now - 1)) {
      fail("isPenalty should return false on past time.");
    }
    pt.applyPenalty(now - 1, 73);
    if (pt.isPenalty(now + 72)) {
      fail("isPenalty should not return edge time after reset.");
    }
  }
}
View Full Code Here

Examples of org.encog.ml.ea.sort.MaximizeAdjustedScoreComp.applyPenalty()

  }
 
  @Test
  public void testApplyPenalty() {
    MaximizeAdjustedScoreComp comp = new MaximizeAdjustedScoreComp();
    Assert.assertEquals(9, comp.applyPenalty(10, 0.1), Encog.DEFAULT_DOUBLE_EQUAL);
  }
}
View Full Code Here

Examples of org.encog.ml.ea.sort.MaximizeScoreComp.applyPenalty()

  }
 
  @Test
  public void testApplyPenalty() {
    MaximizeScoreComp comp = new MaximizeScoreComp();
    Assert.assertEquals(9, comp.applyPenalty(10, 0.1), Encog.DEFAULT_DOUBLE_EQUAL);
  }
}
View Full Code Here

Examples of org.encog.ml.ea.sort.MinimizeAdjustedScoreComp.applyPenalty()

  }
 
  @Test
  public void testApplyPenalty() {
    MinimizeAdjustedScoreComp comp = new MinimizeAdjustedScoreComp();
    Assert.assertEquals(11, comp.applyPenalty(10, 0.1), Encog.DEFAULT_DOUBLE_EQUAL);
  }
}
View Full Code Here

Examples of org.encog.ml.ea.sort.MinimizeScoreComp.applyPenalty()

  }
 
  @Test
  public void testApplyPenalty() {
    MinimizeScoreComp comp = new MinimizeScoreComp();
    Assert.assertEquals(11, comp.applyPenalty(10, 0.1), Encog.DEFAULT_DOUBLE_EQUAL);
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.