V2_0.java [src/java/m/sq/sci] Revision: default  Date:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package m.sq.sci;

import csip.ModelDataService;
import csip.annotations.*;
import static csip.annotations.State.RELEASED;
import static m.sq.Constants.*;
import javax.ws.rs.Path;

/**
 * SCI service.
 *
 * @author od
 */
@Name("SCI")
@Description("SCI")
@State(RELEASED)
@Path("m/sci/2.0")
public class V2_0 extends ModelDataService {

  private double water_sci;
  private double wind_sci;
  private double sci_total;


  @Override
  protected void preProcess() throws Exception {
    water_sci = parameter().getDouble(KEY_SCI_WATER);
    wind_sci = parameter().getDouble(KEY_SCI_WIND);
  }


  @Override
  public void doProcess() throws Exception {
    sci_total = SCICalculator.calculateSCI(water_sci, wind_sci);
  }


  @Override
  protected void postProcess() throws Exception {
    results().put(KEY_SCI_TOTAL, sci_total);
  }

}