diff --git a/pom.xml b/pom.xml index 508534c..65bfb57 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 FARMIND FARMIND - 0.12.0 + 0.12.1 diff --git a/src/main/java/farmind/agent/Farm.java b/src/main/java/farmind/agent/Farm.java index b313a79..fb2e17d 100644 --- a/src/main/java/farmind/agent/Farm.java +++ b/src/main/java/farmind/agent/Farm.java @@ -150,7 +150,7 @@ public List decideActivitySet(List allFarms, Properties cmd) { FuzzyLogicCalculator fuzzyLogicCalc = new FuzzyLogicCalculator(this, allFarms); // calculator for the activity selection // modified simulation using only satisfaction - if (cmd.getProperty("uncertainty").equals("0")) { + if (cmd.getProperty("uncertainty", "1").equals("0")) { if (this.Satisfaction >= this.getP_aspiration_coef() ) { this.strategy = 4; //REPETITION for (int i = 0; i < this.getCurrentActivity().size(); i++) { @@ -175,7 +175,7 @@ public List decideActivitySet(List allFarms, Properties cmd) { else { if (this.Activity_Dissimilarity >= this.p_activity_tolerance_coef || this.Income_Dissimilarity >= this.p_income_tolerance_coef) { - if (cmd.getProperty("noOptOut").equals("1") + if (cmd.getProperty("noOptOut", "0").equals("1") || this.Satisfaction >= this.getP_aspiration_coef()) { this.strategy = 2; //IMITATION ActivitySet = fuzzyLogicCalc.getImitationActivities(); diff --git a/src/main/java/farmind/mathematical_programming/FarmDyn.java b/src/main/java/farmind/mathematical_programming/FarmDyn.java index 7cecee4..8508245 100644 --- a/src/main/java/farmind/mathematical_programming/FarmDyn.java +++ b/src/main/java/farmind/mathematical_programming/FarmDyn.java @@ -106,7 +106,7 @@ public void runModel(Properties cmd, int nFarm, int year, boolean pricingAverage * @throws */ private static void createRunGamsBatch(Properties cmd, String OS) throws FileNotFoundException { - if (cmd.getProperty("debug").equals("1")) { + if (cmd.getProperty("debug", "0").equals("1")) { if (OS.equals("win")) { LOGGER.info("Creating run_gams.bat file for debug"); try (PrintWriter writer = new PrintWriter("run_gams.bat")) { diff --git a/src/main/java/farmind/mathematical_programming/SwissLand.java b/src/main/java/farmind/mathematical_programming/SwissLand.java index 71acd8c..769651b 100644 --- a/src/main/java/farmind/mathematical_programming/SwissLand.java +++ b/src/main/java/farmind/mathematical_programming/SwissLand.java @@ -75,7 +75,7 @@ public void runModel(Properties cmd, int nFarm, int year, boolean pricingAverage * @throws FileNotFoundException */ private static void createRunGamsBatch(Properties cmd, String OS) throws FileNotFoundException { - if (cmd.getProperty("debug").equals("1")) { + if (cmd.getProperty("debug", "0").equals("1")) { if (OS.equals("win")) { LOGGER.info("Creating run_gams.bat file for debug"); try (PrintWriter writer = new PrintWriter("run_gams.bat")) { diff --git a/src/main/java/farmind/mathematical_programming/WeedControl.java b/src/main/java/farmind/mathematical_programming/WeedControl.java index c768d5f..9254e09 100644 --- a/src/main/java/farmind/mathematical_programming/WeedControl.java +++ b/src/main/java/farmind/mathematical_programming/WeedControl.java @@ -84,7 +84,7 @@ public void runModel(Properties cmd, int nFarm, int year, boolean pricingAverage * @throws IOException */ private static void createRunGamsBatch(Properties cmd, String OS) throws IOException { - if (cmd.getProperty("debug").equals("1")) { + if (cmd.getProperty("debug", "0").equals("1")) { if (OS.equals("win")) { LOGGER.info("Creating run_gams.bat file for debug"); File f = new File("run_gams.bat");