Additional manual version 4.0x
(for intelligent text, audio or video messages)

JavaTHESIS, your design system for simulations on the web

IN THE JAVA-SOURCE

Place 25, the rule base:

You have to change the rules (for fuzzy logic) (in java) (if you want) of the internal expert system. That is done by checking the rules in the applet, in the loop, where the model is. Here:

here:

//message 1: N1 < 0.5 geeft: "bak half vol" (rule 1)
if ( (N1 < 0.5) && (K1 > 0.0) && (gehad1==0) ) {gehad1=1; vuur1=1; NaarJS("1");}
if ( (N1 < 0.5) && (K1 > 0.0) && (gehad1==1) && (vuur1==1) ) {vuur1=0;}
if ( (N1 < 0.5) && (K1 > 0.0) && (gehad1==1) ) {gehad1=1;} else {gehad1=0;};

//message 2: N2 < 0.1 geeft: bijna leeg (rule 2)
if ( (N1 < 0.1) && (K2 > 0.0) && (gehad2==0) ) {gehad2=2; vuur2=2; NaarJS("2");}
if ( (N1 < 0.1) && (K2 > 0.0) && (gehad2==2) && (vuur2==2) ) {vuur2=0;}
if ( (N1 < 0.1) && (K2 > 0.0) && (gehad2==2) ) {gehad2=2;} else {gehad2=0;};

//message 3: N2 < 0.01 geeft: helemaal leeg (rule 3)
if ( (N1 < 0.01) && (K2 > 0.0) && (gehad3==0) ) {gehad3=3; vuur3=3; NaarJS("3");}
if ( (N1 < 0.01) && (K2 > 0.0) && (gehad3==3) && (vuur3==3) ) {vuur3=0;}
if ( (N1 < 0.01) && (K2 > 0.0) && (gehad3==3) ) {gehad3=3;} else {gehad3=0;};

//message 4: N1 < 0.5 en kraan 1 staat te ver open geeft: xxxx (rule 4)
if ( (N1 < 0.5) && (K1 > 0.1) && (gehad4==0) ) {gehad4=4; vuur4=4; NaarJS("4");}
if ( (N1 < 0.5) && (K1 > 0.1) && (gehad4==4) && (vuur4==4) ) {vuur4=0;}
if ( (N1 < 0.5) && (K1 > 0.1) && (gehad4==4) ) {gehad4=4;} else {gehad4=0;};

//message 5: N1 < 0.5 en kraan 2 staat te ver open geeft: xxxx (rule 5)
if ( (N1 < 0.5) && (K2 > 0.1) && (gehad5==0) ) {gehad5=5; vuur5=5; NaarJS("5");}
if ( (N1 < 0.5) && (K2 > 0.1) && (gehad5==5) && (vuur5==5) ) {vuur5=0;}
if ( (N1 < 0.5) && (K2 > 0.1) && (gehad5==5) ) {gehad5=5;} else {gehad5=0;};

Place xx, xxx:

import netscape.javascript.JSObject;
import netscape.javascript.JSException;

Place xx, xxx:

JSObject jsWindow;
JSException exp;

Place xx, xxx:

int vuur1=0,vuur2=0,vuur3=0,vuur4=0,vuur5=0; //(Nr=5: 1...4)
int gehad1=0,gehad2=0,gehad3=0,gehad4=0,gehad5=0; //(Nr=5: 1...5)

Place xx, xxx:

void NaarJS(String t)
{
Object args[] = new Object[2];
args[0] = getParameter("name");
args[1] = t;
if (jsWindow!=null) jsWindow.call("infoFromJava",args);
else System.out.println("Cannot call JavaScript, because jsWindow is null");
}

Place xx, xxx:

try
{jsWindow = JSObject.getWindow(this);}
catch (Exception e)
{System.out.println("Error in JSObject.getWindow, " + e.getMessage());}


IN THE HTML-SOURCE

Place xx, xxx:

<SCRIPT>
function infoFromJava(cardioname,event)
{
if (event==1)
{
window.open('message1.htm','x1',
'width=420,height=100,top=430,left=0,scrollbars=yes');
}
if (event==2)
{
window.open('message2.htm','x2',
'width=420,height=100,top=430,left=200,scrollbars=yes');
}
if (event==3)
{
window.open('message3.htm','x3',
'width=420,height=100,top=430,left=400,scrollbars=yes');
}
}
</SCRIPT>

Enschede, sept. 7, 2000; updated 2004.