V1_0.java [src/java/m/wqm/sednutpractscores] Revision: 57281417573acfbd07cdc35f404ca159aed79047  Date: Sat Nov 14 12:54:30 MST 2015
package m.wqm.sednutpractscores;

import csip.ModelDataService;
import static csip.ModelDataService.EXEC_OK;
import csip.ServiceException;
import java.util.ArrayList;
import javax.ws.rs.Path;
import oms3.annotations.Description;
import oms3.annotations.Name;
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONObject;
import csip.utils.JSONUtils;
import java.util.Map;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.codehaus.jettison.json.JSONException;

@Name("WQM-15: Sediment and Nutrient Practice Scores (SedNutPractScores)")
@Description("This service computes scores for conservation practices applied to mitigate nitrogen leaching, sediment runoff, nitrogen runoff, and phosphorus runoff loss potential.")
@Path("m/nut_pract_scores/1.0")

/**
 *
 * @author SrinivasReddy kontham
 * @author Shaun Case
 */
public class V1_0 extends ModelDataService {

    private ArrayList<V1_0.Input> components = new ArrayList<>(); // store the set of all input soilcomponents as objects
    private ArrayList<V1_0.Result1> result1 = new ArrayList<>();  // store the result as objects
    private int nleach_pract_score = 0;
    private int nleach_avoid_pract_score = 0;
    private int nleach_control_pract_score = 0;
    private int nleach_trap_pract_score = 0;
    private int nsurf_pract_score = 0;
    private int nsurf_avoid_pract_score = 0;
    private int nsurf_control_pract_score = 0;
    private int nsurf_trap_pract_score = 0;
    private int psurf_pract_score = 0;
    private int psurf_avoid_pract_score = 0;
    private int psurf_control_pract_score = 0;
    private int psurf_trap_pract_score = 0;
    private int ssurf_pract_score = 0;
    private int ssurf_avoid_pract_score = 0;
    private int ssurf_control_pract_score = 0;
    private int ssurf_trap_pract_score = 0;
    private int AoAid;

    private String error_msg;

    @Override
    protected void preProcess() {
        this.nleach_pract_score = 0;
        this.nleach_avoid_pract_score = 0;
        this.nleach_control_pract_score = 0;
        this.nleach_trap_pract_score = 0;
        this.nsurf_pract_score = 0;
        this.nsurf_avoid_pract_score = 0;
        this.nsurf_control_pract_score = 0;
        this.nsurf_trap_pract_score = 0;
        this.psurf_pract_score = 0;
        this.psurf_avoid_pract_score = 0;
        this.psurf_control_pract_score = 0;
        this.psurf_trap_pract_score = 0;
        this.ssurf_pract_score = 0;
        this.ssurf_avoid_pract_score = 0;
        this.ssurf_control_pract_score = 0;
        this.ssurf_trap_pract_score = 0;
        this.error_msg = "";

        this.components = new ArrayList<>();
        this.result1 = new ArrayList<>();

        try {

            JSONArray groups = getJSONArrayParam("pestcomponents");
            for (int i = 0; i < groups.length(); i++) {
                Map<String, JSONObject> group = JSONUtils.preprocess(groups.getJSONArray(i));

                AoAid = JSONUtils.getIntParam(group, "AoAid", 0);
                int plan_pract_id = JSONUtils.getIntParam(group, "plan_practice_id", 0);
                String plan_pract_discrim_type = JSONUtils.getStringParam(group, "plan_practice_discrim_type", "err");
                String plan_pract_discrim_value = JSONUtils.getStringParam(group, "plan_practice_discrim_value", "err");
                components.add(new V1_0.Input(AoAid, plan_pract_id, plan_pract_discrim_type, plan_pract_discrim_value));
            }
        } catch (JSONException ex) {
            this.error_msg = "Cannot process the input JSON: " + ex.getMessage();
            LOG.log(Level.SEVERE, this.error_msg);
        } catch (ServiceException ex) {
            this.error_msg = "Cannot process the input JSON: " + ex.getMessage();
            LOG.log(Level.SEVERE, this.error_msg);
        }
    }

    @Override
    protected String process() throws Exception {
        if (this.error_msg.isEmpty()) {
            try (
                    Connection conn = wqm.utils.WQMTools.getConnection("wqm", LOG);
                    Statement statement = conn.createStatement();) {
                for (V1_0.Input ip : components) {
                    String query;
                    //  #Compute practice mitigation scores for Nitrogen in Ground Water and increment total scores
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id='" + ip.plan_practice_id + "'AND wqm_concern=" + "'" + "Nitrogen in Ground Water" + "'AND mode_of_action=" + "'" + "Avoid" + "' AND COALESCE(pract_discrim_type, '') = ''";

                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id='" + ip.plan_practice_id + "'AND wqm_concern=" + "'" + "Nitrogen in Ground Water" + "'AND mode_of_action=" + "'" + "Avoid" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    ResultSet results = statement.executeQuery(query);

                    while (results.next()) {
                        int nl_avoid_pract_score = results.getInt("nut_pract_score");
                        nleach_avoid_pract_score += nl_avoid_pract_score;
                    }
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Nitrogen in Ground Water" + "'AND mode_of_action=" + "'" + "Control" + "' AND COALESCE(pract_discrim_type, '') = ''";
                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Nitrogen in Ground Water" + "'AND mode_of_action=" + "'" + "Control" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    results = statement.executeQuery(query);

                    while (results.next()) {
                        int nl_control_pract_score = results.getInt("nut_pract_score");
                        nleach_control_pract_score += nl_control_pract_score;
                    }
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Nitrogen in Ground Water" + "'AND mode_of_action=" + "'" + "Trap" + "' AND COALESCE(pract_discrim_type, '') = ''";
                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Nitrogen in Ground Water" + "'AND mode_of_action=" + "'" + "Trap" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    results = statement.executeQuery(query);

                    while (results.next()) {
                        int nl_trap_pract_score = results.getInt("nut_pract_score");
                        nleach_trap_pract_score += nl_trap_pract_score;
                    }
                    nleach_pract_score = nleach_trap_pract_score + nleach_control_pract_score + nleach_avoid_pract_score;
                    // #Compute practice mitigation scores for Sediment in Surface Water and increment total scores   
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Sediment in Surface Water" + "'AND mode_of_action=" + "'" + "Avoid" + "' AND COALESCE(pract_discrim_type, '') = ''";
                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Sediment in Surface Water" + "'AND mode_of_action=" + "'" + "Avoid" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    results = statement.executeQuery(query);

                    while (results.next()) {
                        int sd_avoid_pract_score = results.getInt("nut_pract_score");
                        ssurf_avoid_pract_score += sd_avoid_pract_score;
                    }
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Sediment in Surface Water" + "'AND mode_of_action=" + "'" + "Control" + "' AND COALESCE(pract_discrim_type, '') = ''";
                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Sediment in Surface Water" + "'AND mode_of_action=" + "'" + "Control" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    results = statement.executeQuery(query);

                    while (results.next()) {
                        int sd_control_pract_score = results.getInt("nut_pract_score");
                        ssurf_control_pract_score += sd_control_pract_score;
                    }
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Sediment in Surface Water" + "'AND mode_of_action=" + "'" + "Trap" + "' AND COALESCE(pract_discrim_type, '') = ''";
                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Sediment in Surface Water" + "'AND mode_of_action=" + "'" + "Trap" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    results = statement.executeQuery(query);

                    while (results.next()) {
                        int sd_trap_pract_score = results.getInt("nut_pract_score");
                        ssurf_trap_pract_score += sd_trap_pract_score;
                    }
                    ssurf_pract_score = ssurf_trap_pract_score + ssurf_control_pract_score + ssurf_avoid_pract_score;
                    // #Increment practice mitigation scores for Nitrogen in Surface Water and increment total scores
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Nitrogen in Surface Water" + "'AND mode_of_action=" + "'" + "Avoid" + "' AND COALESCE(pract_discrim_type, '') = ''";
                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Nitrogen in Surface Water" + "'AND mode_of_action=" + "'" + "Avoid" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    results = statement.executeQuery(query);

                    while (results.next()) {
                        int ns_avoid_pract_score = results.getInt("nut_pract_score");
                        nsurf_avoid_pract_score += ns_avoid_pract_score;
                    }
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Nitrogen in Surface Water" + "'AND mode_of_action=" + "'" + "Control" + "' AND COALESCE(pract_discrim_type, '') = ''";
                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Nitrogen in Surface Water" + "'AND mode_of_action=" + "'" + "Control" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    results = statement.executeQuery(query);

                    while (results.next()) {
                        int ns_control_pract_score = results.getInt("nut_pract_score");
                        nsurf_control_pract_score += ns_control_pract_score;
                    }
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Nitrogen in Surface Water" + "'AND mode_of_action=" + "'" + "Trap" + "' AND COALESCE(pract_discrim_type, '') = ''";
                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Nitrogen in Surface Water" + "'AND mode_of_action=" + "'" + "Trap" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    results = statement.executeQuery(query);

                    while (results.next()) {
                        int ns_trap_pract_score = results.getInt("nut_pract_score");
                        nsurf_trap_pract_score += ns_trap_pract_score;
                    }
                    nsurf_pract_score = nsurf_trap_pract_score + nsurf_control_pract_score + nsurf_avoid_pract_score;
                    // #Increment practice mitigation scores for Phosphorus in Surface Water and increment total scores                
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Phosphorus in Surface Water" + "'AND mode_of_action=" + "'" + "Avoid" + "' AND COALESCE(pract_discrim_type, '') = ''";
                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Phosphorus in Surface Water" + "'AND mode_of_action=" + "'" + "Avoid" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    results = statement.executeQuery(query);

                    while (results.next()) {
                        int ps_avoid_pract_score = results.getInt("nut_pract_score");
                        psurf_avoid_pract_score += ps_avoid_pract_score;
                    }
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Phosphorus in Surface Water" + "'AND mode_of_action=" + "'" + "Control" + "' AND COALESCE(pract_discrim_type, '') = ''";
                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Phosphorus in Surface Water" + "'AND mode_of_action=" + "'" + "Control" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    results = statement.executeQuery(query);

                    while (results.next()) {
                        int ps_control_pract_score = results.getInt("nut_pract_score");
                        psurf_control_pract_score += ps_control_pract_score;
                    }
                    if (ip.plan_practice_discrim_type.isEmpty()) {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Phosphorus in Surface Water" + "'AND mode_of_action=" + "'" + "Trap" + "' AND COALESCE(pract_discrim_type, '') = ''";
                    } else {
                        query = "SELECT nut_pract_score FROM wqm_sediment_nutrient_practice_scores WHERE practice_id=" + ip.plan_practice_id + "AND wqm_concern=" + "'" + "Phosphorus in Surface Water" + "'AND mode_of_action=" + "'" + "Trap" + "'AND CAST(min_pract_discrim AS int)<=" + Integer.parseInt(ip.plan_practice_discrim_value) + "AND CAST(max_pract_discrim AS int)>" + Integer.parseInt(ip.plan_practice_discrim_value);
                    }

                    results = statement.executeQuery(query);

                    while (results.next()) {
                        int ps_trap_pract_score = results.getInt("nut_pract_score");
                        psurf_trap_pract_score += ps_trap_pract_score;
                    }
                    psurf_pract_score = psurf_trap_pract_score + psurf_control_pract_score + psurf_avoid_pract_score;
                }
                result1.add(new V1_0.Result1(AoAid, nleach_pract_score, ssurf_pract_score, nsurf_pract_score, psurf_pract_score, nleach_avoid_pract_score, nleach_control_pract_score, nleach_trap_pract_score, ssurf_avoid_pract_score, ssurf_control_pract_score, ssurf_trap_pract_score, nsurf_avoid_pract_score, nsurf_control_pract_score, nsurf_trap_pract_score, psurf_avoid_pract_score, psurf_control_pract_score, psurf_trap_pract_score));
            } catch (NumberFormatException | SQLException ex) {
                this.error_msg = "Cannot process that request: " + ex.getMessage();
                LOG.log(Level.SEVERE, this.error_msg);
            }
        }
        return (this.error_msg.isEmpty() ? EXEC_OK : this.error_msg);
    }

    @Override
    protected void postProcess() throws Exception {
        if (this.error_msg.isEmpty()) {
            try {
                JSONArray result1Arr = new JSONArray();
                for (V1_0.Result1 rs1 : result1) {
                    JSONArray tmpArr = new JSONArray();
                    tmpArr.put(JSONUtils.dataDesc("AoAId", AoAid, "Area of Analysis Identifier"));
                    tmpArr.put(JSONUtils.dataDesc("nleach_pract_score", rs1.nleach_pract_score, " Nitrogen Leaching Practice Mitigation Score"));
                    tmpArr.put(JSONUtils.dataDesc("nsurf_pract_score", rs1.nsurf_pract_score, "Sediment Runoff Practice Mitigation Score"));
                    tmpArr.put(JSONUtils.dataDesc("ssurf_pract_score", rs1.ssurf_pract_score, "Nitrogen Runoff Practice Mitigation Score"));
                    tmpArr.put(JSONUtils.dataDesc("psurf_pract_score", rs1.psurf_pract_score, "Phosphorus Runoff Practice Mitigation Score"));
                    tmpArr.put(JSONUtils.dataDesc("nleach_avoid_pract_score", rs1.nleach_avoid_pract_score, "Nitrogen Leaching Practice Score (Avoid)"));
                    tmpArr.put(JSONUtils.dataDesc("nleach_control_pract_score", rs1.nleach_control_pract_score, "Nitrogen Leaching Practice Score (Control)"));
                    tmpArr.put(JSONUtils.dataDesc("nleach_trap_pract_score", rs1.nleach_trap_pract_score, "Nitrogen Leaching Practice Score (Trap)"));
                    tmpArr.put(JSONUtils.dataDesc("ssurf_avoid_pract_score", rs1.ssurf_avoid_pract_score, "Sediment Runoff Practice Score (Avoid)"));
                    tmpArr.put(JSONUtils.dataDesc("ssurf_control_pract_score", rs1.ssurf_control_pract_score, "Sediment Runoff Practice Score (Control)"));
                    tmpArr.put(JSONUtils.dataDesc("ssurf_trap_pract_score", rs1.ssurf_trap_pract_score, "Sediment Runoff Practice Score (Trap)"));
                    tmpArr.put(JSONUtils.dataDesc("nsurf_avoid_pract_score", rs1.nsurf_avoid_pract_score, "Nitrogen Runoff Practice Score (Avoid)"));
                    tmpArr.put(JSONUtils.dataDesc("nsurf_control_pract_score", rs1.nsurf_control_pract_score, "Nitrogen Runoff Practice Score (Control)"));
                    tmpArr.put(JSONUtils.dataDesc("nsurf_trap_pract_score", rs1.nsurf_trap_pract_score, "Nitrogen Runoff Practice Score (Trap)"));
                    tmpArr.put(JSONUtils.dataDesc("psurf_avoid_pract_score", rs1.psurf_avoid_pract_score, "Phosphorus Runoff Practice Score (Avoid)"));
                    tmpArr.put(JSONUtils.dataDesc("psurf_control_pract_score", rs1.psurf_control_pract_score, "Phosphorus Runoff Practice Score (Control)"));
                    tmpArr.put(JSONUtils.dataDesc("psurf_trap_pract_score", rs1.psurf_trap_pract_score, "Phosphorus Runoff Practice Score (Trap)"));
                    result1Arr.put(JSONUtils.dataDesc("(AoASedNutPractScore)", tmpArr, "(AoASedNutPractScore)"));
                }

                putResult("operation", result1Arr);
            } catch (JSONException ex) {
                this.error_msg = "Could not create result JSON: " + ex.getMessage();
                LOG.log(Level.SEVERE, this.error_msg);
                throw new Exception(this.error_msg);
            }
        }
    }

    public class Input {

        int AoAid;
        int plan_practice_id;
        String plan_practice_discrim_type;
        String plan_practice_discrim_value;

        public Input(int AoAid, int plan_practice_id, String plan_practice_discrim_type, String plan_practice_discrim_value) {
            this.AoAid = AoAid;
            this.plan_practice_id = plan_practice_id;
            this.plan_practice_discrim_type = plan_practice_discrim_type;
            this.plan_practice_discrim_value = plan_practice_discrim_value;

        }

    }

    public class Result1 {

        int nleach_pract_score = 0;
        int nleach_avoid_pract_score = 0;
        int nleach_control_pract_score = 0;
        int nleach_trap_pract_score = 0;
        int nsurf_pract_score = 0;
        int nsurf_avoid_pract_score = 0;
        int nsurf_control_pract_score = 0;
        int nsurf_trap_pract_score = 0;
        int psurf_pract_score = 0;
        int psurf_avoid_pract_score = 0;
        int psurf_control_pract_score = 0;
        int psurf_trap_pract_score = 0;
        int ssurf_pract_score = 0;
        int ssurf_avoid_pract_score = 0;
        int ssurf_control_pract_score = 0;
        int ssurf_trap_pract_score = 0;
        int AoAid;

        public Result1(int AoAid, int nleach_pract_score, int ssurf_pract_score, int nsurf_pract_score, int psurf_pract_score, int nleach_avoid_pract_score, int nleach_control_pract_score, int nleach_trap_pract_score, int ssurf_avoid_pract_score, int ssurf_control_pract_score, int ssurf_trap_pract_score, int nsurf_avoid_pract_score, int nsurf_control_pract_score, int nsurf_trap_pract_score, int psurf_avoid_pract_score, int psurf_control_pract_score, int psurf_trap_pract_score) {
            this.nleach_pract_score = nleach_pract_score;
            this.nleach_avoid_pract_score = nleach_avoid_pract_score;
            this.nleach_control_pract_score = nleach_control_pract_score;
            this.nleach_trap_pract_score = nleach_trap_pract_score;
            this.nsurf_pract_score = nsurf_pract_score;
            this.nsurf_avoid_pract_score = nsurf_avoid_pract_score;
            this.nsurf_control_pract_score = nsurf_control_pract_score;
            this.nsurf_trap_pract_score = nsurf_trap_pract_score;
            this.psurf_pract_score = psurf_pract_score;
            this.psurf_avoid_pract_score = psurf_avoid_pract_score;
            this.psurf_control_pract_score = psurf_control_pract_score;
            this.psurf_trap_pract_score = psurf_trap_pract_score;
            this.ssurf_pract_score = ssurf_pract_score;
            this.ssurf_avoid_pract_score = ssurf_avoid_pract_score;
            this.ssurf_control_pract_score = ssurf_control_pract_score;
            this.ssurf_trap_pract_score = ssurf_trap_pract_score;
            this.AoAid = AoAid;
        }
    }
}