Package ch.tatool.data

Examples of ch.tatool.data.Module


  /**
   * Initializes the algorithm with the values of the DB at session start
   */
  protected void initializeHandler(ExecutionContext context) {
    Module module = context.getExecutionData().getModule();
    benchmarkTotalPoints = benchmarkTotalPointsProperty.getValue(module, this, 0.0);
    benchmarkMaxPoints = benchmarkMaxPointsProperty.getValue(module, this, 0.0);
   
    totalScore = benchmarkTotalPoints;
    maxScore = benchmarkMaxPoints;
View Full Code Here


 
  /**
   * Initializes the algorithm with the values of the DB.
   */
  public void initializeAlgorithm(ExecutionContext event) {
    Module module = event.getExecutionData().getModule();
    counter = counterProperty.getValue(module, this, 0);
    benchmark = benchmarkProperty.getValue(module, this, 0.0);

    if (benchmark > 0) {
      doBenchmark = false; // we already have a benchmark
View Full Code Here

  /**
   * Initializes the algorithm with the values of the DB.
   */
  public void initializeAlgorithm(ExecutionContext event) {
    Module module = event.getExecutionData().getModule();

    // get the counters from the module
    trialCounter = trialCounterProperty.getValue(module, this, 0);
  }
View Full Code Here

      }
    }

  /** Initializes this aspect. */
  private void initialize(ExecutionContext event) {
    Module module = event.getExecutionData().getModule();
    // read the last timeout data from the module aspect properties, use
    // default value if not provided
    long timeoutDuration = getDefaultTimerDuration();
    timeoutDuration = durationProperty.getValue(module, this, timeoutDuration);
    setDefaultTimerDuration(timeoutDuration);
View Full Code Here

  /**
   * Reduces the timer by the factor f with a minimum of minDuration
   */
  public void decreaseTimeoutDuration(ExecutionContext event) {
    Module module = event.getExecutionData().getModule();
    long newDuration = 0;
    newDuration = (long) (((float) getDefaultTimerDuration()) * factor);
    if (newDuration < minTimerDuration) {
      // set the minimal duration
      durationProperty.setValue(module, this, minTimerDuration);
View Full Code Here

  /**
   * Increases the timer by the factor f with a maximum of maxDuration
   */
  public void increaseTimeoutDuration(ExecutionContext event) {
    Module module = event.getExecutionData().getModule();
    long newDuration = 0;
    newDuration = (long) (((float) getDefaultTimerDuration()) / factor);
    if (newDuration > maxTimerDuration) {
      // set the maximal duration
      durationProperty.setValue(module, this, maxTimerDuration);
View Full Code Here

    @Override
    protected void updateTotals(ExecutionContext context) {
      super.updateTotals(context);
     
      // also update the current levels total in the module
      Module module = context.getExecutionData().getModule();
      int currentLevelTotal = levelTotalProperty.getValue(module, this, 0);
      for (Trial trial : context.getExecutionData().getTrials()) {
        currentLevelTotal += levelTotalProperty.getValue(trial, this, 0);
      }
      levelTotalProperty.setValue(module, this, currentLevelTotal);
View Full Code Here

     * Compares the current level total value to the boundary value, and adapts the level accordingly.
     */
    @Override
    protected int checkLevelChange(ExecutionContext context, int currentLevel) {
      // get the current total and the boundary value
      Module module = context.getExecutionData().getModule();
      int currentTotal = levelTotalProperty.getValue(module, this, 0);
      int newTotal = currentTotal;
      int boundryValue = boundaryProperty.getValue(this, DEFAULT_BOUNDARY_VALUE);
     
      // check for boundary and adapt level and points
View Full Code Here

  private void finish(ModuleCreationWorker worker) {
    // hide the progress bar
    progressDialog.setVisible(false);
   
    // check whether we got a module
    Module t = worker.getModule();
    if (t == null) {
      JOptionPane.showMessageDialog(parent, worker.getErrorText(), worker.getErrorTitle(), JOptionPane.ERROR_MESSAGE);
    }

    // close the creator
View Full Code Here

        break;
      }
    }
    // load the module if we have a module info object
    if (tInfo != null) {
      Module module = moduleService.loadModule(tInfo);
      // bypass the setter here
      this.module = module;
    }
  }
View Full Code Here

TOP

Related Classes of ch.tatool.data.Module

Copyright © 2018 www.massapicom. 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.