forked from kevin.shehu/GGD
CHANGE: REDEFINING THE STRUCTURE
FIX: ApiCall.java ADD: ISIS IC Server REQ ADD: RULES
This commit is contained in:
18
src/main/resources/rules/Battery.drl
Normal file
18
src/main/resources/rules/Battery.drl
Normal file
@@ -0,0 +1,18 @@
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Iterator;
|
||||
import eu.hsrw.ias.ggd.ScheduledTask
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
rule "Low Battery Level"
|
||||
|
||||
when
|
||||
$map : Map (this["battery"]<5.5)
|
||||
|
||||
then
|
||||
System.out.println("Low Battery : "+$map.get("battery")+"! Please swap the battery soon");
|
||||
JOptionPane.showMessageDialog(null,"Low Battery : "+$map.get("battery")+"! Please swap the battery soon","Low Battery Level",JOptionPane.INFORMATION_MESSAGE);
|
||||
|
||||
|
||||
end
|
21
src/main/resources/rules/SoilConductivity.drl
Normal file
21
src/main/resources/rules/SoilConductivity.drl
Normal file
@@ -0,0 +1,21 @@
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Iterator;
|
||||
import eu.hsrw.ias.ggd.ScheduledTask;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
rule "Optimal EC levels in the soil"
|
||||
|
||||
when
|
||||
$map : Map (this["soilConductivity"]<0.57 && this["soilConductivity"]>0.11)
|
||||
|
||||
then
|
||||
System.out.println("Optimal EC levels in the soil : "+$map.get("soilConductivity"));
|
||||
JOptionPane.showMessageDialog(null,"Optimal EC levels in the soil : "+$map.get("soilConductivity"),"Soil Conductivity",JOptionPane.INFORMATION_MESSAGE);
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
29
src/main/resources/rules/SoilMoisture.drl
Normal file
29
src/main/resources/rules/SoilMoisture.drl
Normal file
@@ -0,0 +1,29 @@
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Iterator;
|
||||
import eu.hsrw.ias.ggd.ScheduledTask;
|
||||
import javax.swing.JOptionPane;
|
||||
rule "Dry Soil Moisture"
|
||||
|
||||
when
|
||||
$map : Map (this["soilMoisture"]<40)
|
||||
|
||||
then
|
||||
System.out.println("It is recommended to have a Soil Moisture higher than : "+$map.get("soilMoisture"));
|
||||
JOptionPane.showMessageDialog(null,"It is recommended to have a Soil Moisture higher than : "+$map.get("soilMoisture"),"Dry Soil Moisture",JOptionPane.INFORMATION_MESSAGE);
|
||||
|
||||
end
|
||||
|
||||
rule "Wet Soil Mositure"
|
||||
when
|
||||
$map : Map (this["soilMoisture"]>70)
|
||||
|
||||
then
|
||||
System.out.println("Be careful the soil is extremly wet :"+$map.get("soilMoisture")+ "please dont apply water");
|
||||
JOptionPane.showMessageDialog(null,"Be careful the soil is extremly wet :"+$map.get("soilMoisture")+ "please dont apply water","Wet Soil Moisture",JOptionPane.INFORMATION_MESSAGE);
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
@@ -1,14 +0,0 @@
|
||||
import Knowledgebase.Product
|
||||
|
||||
rule "Offer for Diamond"
|
||||
when
|
||||
productObject: Product(type=="diamond")
|
||||
then
|
||||
productObject.setDiscount(15);
|
||||
end
|
||||
rule "Offer for Gold"
|
||||
when
|
||||
productObject: Product(type=="gold")
|
||||
then
|
||||
productObject.setDiscount(10);
|
||||
end
|
Reference in New Issue
Block a user