Module LoggingProcess
[hide private]
[frames] | no frames]

Source Code for Module LoggingProcess

 1  #!/usr/bin/env python 
 2  # -*- coding: iso-8859-1 -*- 
 3   
 4  from Process import Process 
 5   
6 -class LoggingProcess(Process):
7 # initialization
8 - def __init__(self,FuzzySystem):
9 Process.__init__(self,FuzzySystem) 10 self.l_rltemp=[] 11 self.l_vltemp=[] 12 self.l_inMischer=[]
13
14 - def step(self,time_step):
15 ftime = self.ftime 16 17 Process.step(self,time_step) 18 19 # for graphical output 20 self.l_inMischer.append([ftime,self.inMischer]) 21 self.l_vltemp.append([ftime,self.vltemp]) 22 self.l_rltemp.append([ftime,self.rltemp]) 23 print " rltemp: %6.3f°C vltemp: %6.3f°C" % (self.rltemp,self.vltemp)
24
25 - def plot(self):
26 #try: 27 import Gnuplot 28 # Graphical output 29 g1 = Gnuplot.Gnuplot() 30 g1.clear() 31 g1(' set style data lines') 32 g1.title('Fuzzy value(red), input media temperature(green), outgoing media temperature(blue)') 33 g1.plot(self.l_inMischer,self.l_vltemp,self.l_rltemp,) 34 g1.hardcopy('Mischer_test.ps',color='yes',mode='landscape') 35 raw_input('Please press return to continue...\n')
36 #except: 37 # pass 38