CHANGE: REDEFINING THE STRUCTURE

FIX: ApiCall.java
ADD: ISIS IC Server REQ
ADD: RULES
This commit is contained in:
2021-08-31 12:02:56 +02:00
parent a07efa82d3
commit cceac4d65d
20 changed files with 337 additions and 203 deletions

View 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

View 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

View 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

View File

@@ -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