Exemplo n.º 1
0
 public Quantity getJudgingTarget(int round) throws ScoreException {
   String targetValue =
       PropertyHelper.indirectPropertyForRound(TARGET_VALUE_PROPNAME, round, props);
   if ("".equals(targetValue)) {
     return getDividend(round);
   }
   return new Quantity(targetValue);
 }
Exemplo n.º 2
0
 private static boolean requiresJudges(String playerName, Properties props) {
   String roleName = props.getProperty(PropertyHelper.dottedWords(playerName, ROLE_PROPERTY_WORD));
   if (roleName == null) {
     return false;
   } else {
     roleName = roleName.trim();
   }
   return roleName.equals(JUDGE_PROPERTY_WORD) || roleName.equals(MANIPULATOR_PROPERTY_WORD);
 }
Exemplo n.º 3
0
  private void logCutoffParameters() {
    String earliest = props.getProperty(EARLIEST_JUDGE_CUTOFF_WORD);
    String latest = props.getProperty(LATEST_JUDGE_CUTOFF_WORD);
    String simultaneity = props.getProperty(SIMULTANEOUS_JUDGE_CUTOFF_WORD);
    sliderLabelStepSize = PropertyHelper.getSliderLabelStepSize(props);
    sliderInputStepSize = PropertyHelper.getSliderInputStepSize(props);
    Logger logger = PropertyHelper.configLogger();
    if (earliest == null && latest == null && simultaneity == null) {
      earliestCutoff = 0;
      latestCutoff = 0;
      timer = null;

      logger.info("Not cutting off judges.");
      return;
    }

    timer = new Timer();
    DEAD_TASK =
        new TimerTask() {
          public void run() {
            /* empty */
          }
        };
    timer.schedule(DEAD_TASK, new Date().getTime()); // scheduledExecutionTime() is in the past

    int roundDuration = timeLimit();
    if (earliest == null || earliest.length() == 0) {
      earliestCutoff = (roundDuration - 60);
      logger.info("Defaulting Earliest Cutoff to one minute before round end: " + earliestCutoff);
    } else {
      earliestCutoff = PropertyHelper.parseTimeStringAsSeconds(earliest);
      logger.info("Earliest Judge Cutoff: " + earliestCutoff);
    }

    if (latest == null || latest.length() == 0) {
      latestCutoff = roundDuration + 10;
      logger.info(
          "Defaulting Latest Cutoff to round duration: " + roundDuration + " plus 10 seconds");
    } else {
      latestCutoff = PropertyHelper.parseTimeStringAsSeconds(latest);
      logger.info("Latest Judge Cutoff: " + latestCutoff);
    }

    simultaneousCutoff = PropertyHelper.parseBoolean(SIMULTANEOUS_JUDGE_CUTOFF_WORD, props, false);
  }
Exemplo n.º 4
0
 protected void logSessionInitialization() {
   super.logSessionInitialization();
   logCutoffParameters();
   logScoringParameters(PropertyHelper.configLogger());
 }
Exemplo n.º 5
0
 public Quantity initialManipulatorTickets() {
   String manipulatorTicketsProp =
       PropertyHelper.dottedWords(TICKETS_PROPERTY_WORD, MANIPULATOR_PROPERTY_WORD);
   return new Quantity(PropertyHelper.parseDouble(manipulatorTicketsProp, props));
 }