![](bg5.png)
i n t p o i n t s = 1 01 ;
i n t andMethod = 0 ;
i n t orMethod = 0;
i n t impMethod = 0 ;
i n t aggMethod = 0 ;
/ / C r e a t i n g a new i n p u t S t a c k o f
i n p u t L i s t
A r r a y L i s t <A r r a y L i s t <Double>>
i n p u t S t a c k = new A r r a y L i s t <
A r r a y L i s t <Double >>() ;
/ / C r e a t i n g an i n p u t l i s t
A r r a y L i s t <Double> i n p u t L i s t = s p a c e .
g e t L i n s p a c e ( −20 , 2 0 , p o i n t s ) ;
/ / A dding i n p u t l i s t t o i n p u t S t a c k
i n p u t S t a c k . add ( i n p u t L i s t ) ;
/ / E v a l u a t i n g i n p u t S t a c k w i t h
S i n g l e t o n −C e n t r o i d meth o d on f i s
f i s . e v a l u a t e F i s S i n g l e t o n C e n t r o i d (
i n p u t S t a c k , p o i n t s , andMethod ,
orMethod , impMethod , aggMethod ) ;
3 WATER TEMPERATURE AND
FLOW CONTROLLER TEST
CASE
To test the JT2FIS we going to use Water Temper-
ature and Flow Controller case. Water Temperature
and Flow Controller is a proposed problem that is
provided by Matlab as a example to show how to
use Fuzzy Logic Toolbox. Castro et. al. (Castro
et al., 2007) extends Matlab Toolbox to Type-2 Fuzzy
Logic, so we going to use this toolbox to compare our
approach with it.
We configured in the same way the Type-2 Fuzzy
Inference System using JT2FIS and Matlab Interval
Type-2 Fuzzy Toolbox.
The system implements the following rules:
1. If (Temp is Cold) and (Flow is Soft) then (Cold is
openSlow)(Hot is openFast)
2. If (Temp is Cold) and (Flow is Good) then (Cold
is closeSlow)(Hot is openSlow)
3. If (Temp is Cold) and (Flow is Hard) then (Cold
is closeFast)(Hot is closeSlow)
4. If (Temp is Good) and (Flow is Soft) then (Cold is
openSlow)(Hot is openSlow)
5. If (Temp is Good) and (Flow is Good) then (Cold
is Steady)(Hot is Steady)
6. If (Temp is Good) and (Flow is Hard) then (Cold
is closeSlow)(Hot is closeSlow)
7. If (Temp is Hot) and (Flow is Soft) then (Cold is
openFast)(Hot is openSlow)
Table 3: Inputs, Outputs example ”ISHOWER”.
Type MemberFunction Params
Input1 TrapaUncertaintyMemberFunction a1=-31,b1=-31,c1=-16,d1=-1,
a2=-29,b2=-29,c2=-14,d2=1.0,alfa=0.98
Input1 TriUncertaintyMemberFunction a1=-11,b1=-1,c1=9,a2=-9,b2=1,c2=11
Input1 TrapaUncertaintyMemberFunction a1=-1,b1=14,c1=29,d1=29,
a2=1,b2=16,c2=31,d2=31,alfa=0.98
Input2 TrapaUncertaintyMemberFunction a1=-3.1,b1=-3.1,c1=-0.9,d1=-0.1,
a2=-2.9,b2=-2.9,c2=-0.7,d2=0.1,alfa=0.98
Input2 TriUncertaintyMemberFunction a1=-0.45,b1=-0.05,c1=0.35,a2=-0.35,b2=0.05,c2=0.45
Input2 TrapaUncertaintyMemberFunction a1=-0.1,b1=0.7,c1=2.9,d1=0.1,
a2=0.9,b2=3.1,c2=3.1,d2=0.1,alfa=0.98
Output1 TriUncertaintyMemberFunction a1=-1.05,b1=-0.65,c1=-0.35,a2=-0.95,b2=-0.55,c2=-0.25
Output1 TriUncertaintyMemberFunction a1=-0.65,b1=-0.35,c1=-0.05,a2=-0.55,b2=-0.25,c2=0.05
Output1 TriUncertaintyMemberFunction a1=-0.35,b1=-0.05,c1=0.25,a2=-0.25,b2=0.05,c2=0.35
Output1 TriUncertaintyMemberFunction a1=-0.05,b1=0.25,c1=0.55,a2=0.05,b2=0.35,c2=0.65
Output1 TriUncertaintyMemberFunction a1=0.25,b1=0.55,c1=0.95,a2=0.35,b2=0.65,c2=1.05
Output2 TriUncertaintyMemberFunction a1=-1.05,b1=-0.65,c1=-0.35,a2=-0.95,b2=-0.55,c2=-0.25
Output2 TriUncertaintyMemberFunction a1=-0.65,b1=-0.35,c1=-0.05,a2=-0.55,b2=-0.25,c2=0.05
Output2 TriUncertaintyMemberFunction a1=-0.35,b1=-0.05,c1=0.25,a2=-0.25,b2=0.05,c2=0.35
Output2 TriUncertaintyMemberFunction a1=-0.05,b1=0.25,c1=0.55,a2=0.05,b2=0.35,c2=0.65
Output2 TriUncertaintyMemberFunction a1=0.25,b1=0.55,c1=0.95,a2=0.35,b2=0.65,c2=1.05
8. If (Temp is Hot) and (Flow is Good) then (Cold is
openSlow)(Hot is closeSlow)
9. If (Temp is Hot)and (Flow is Hard) then (Cold is
closeSlow)(Hot is closeFast)
3.1 JT2FIS Shower System Test Case
Results
With previous fuzzy inference system configuration,
and using 101 points and Centroid reduction type, we
evaluate Water Temperature and Flow Controller in
JT2FIS and Matlab Interval Type-2 Fuzzy Toolbox
implementations. Table 4 show no difference between
tools obtaining the same response.
Table 5 show comparative performance between
tools with different discretizations points for in-
put1=20 and input2=1.
4 CONCLUSIONS
JT2FIS is an Object-Oriented Class Library for Build-
ing Java Intelligent Applications using Java Interval
Type-2 Fuzzy Inference System. We present architec-
ture and object oriented design of a JT2FIS class li-
brary. We provide an example of how to create and
configure an Interval Type-2 Fuzzy Inference Sys-
tem in Java and we show a Water Temperature and
ICEIS2013-15thInternationalConferenceonEnterpriseInformationSystems
528