Ignore:
Timestamp:
06/09/13 23:52:36 (11 years ago)
Author:
jripsl
Message:

Add demo scenarios.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Monitoring/smon/types.py

    r865 r866  
    22 
    33################################## 
    4 #  @program        smon 
     4#  @program                smon 
    55#  @description    simulation monitor 
    6 #  @copyright      Copyright “(c)2009 Centre National de la Recherche Scientifique CNRS.  
    7 #                             All Rights Reserved” 
    8 #  @svn_file       $Id: types.py 2599 2013-03-24 19:01:23Z jripsl $ 
    9 #  @version        $Rev: 2599 $ 
     6#  @copyright      Copyright “(c)2009 Centre National de la Recherche Scientifique CNRS.  
     7#                                                         All Rights Reserved” 
     8#  @svn_file       $Id: types.py 2599 2013-03-24 19:01:23Z jripsl $ 
     9#  @version                $Rev: 2599 $ 
    1010#  @lastrevision   $Date: 2013-03-24 20:01:23 +0100 (Sun, 24 Mar 2013) $ 
    11 #  @license        CeCILL (http://dods.ipsl.jussieu.fr/jripsl/smon/LICENSE) 
     11#  @license                CeCILL (http://dods.ipsl.jussieu.fr/jripsl/smon/LICENSE) 
    1212################################## 
    1313 
     
    2525                self.msg=msg 
    2626 
    27     def __str__(self): 
    28         return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 
     27        def __str__(self): 
     28                return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 
    2929 
    3030class Tree(): 
    3131 
    32     def __init__(self,**kw): 
     32        def __init__(self,**kw): 
    3333                pass 
    3434 
    35     def __str__(self): 
    36         return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 
     35        def __str__(self): 
     36                return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 
    3737 
    3838class Simulation(): 
    3939 
    40     def __init__(self,**kw): 
     40        def __init__(self,**kw): 
    4141                self.exec_start_date=kw.get("exec_start_date") 
    4242                self.exec_end_date=kw.get("exec_end_date") 
    4343                self.status=kw.get("status") 
     44                self.name=kw.get("name") 
    4445 
    45     def __str__(self): 
    46         return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 
     46        def __str__(self): 
     47                return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 
     48 
     49class Message(): 
     50 
     51        def __init__(self,JSON_KW): 
     52                for key in JSON_KW: 
     53                        setattr(self, key, JSON_KW[key]) 
     54 
     55        def __str__(self): 
     56                return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 
    4757 
    4858class SimulationTree(Tree): 
    4959 
    50     def __init__(self,**kw): 
     60        def __init__(self,**kw): 
    5161                dg = nx.DiGraph() 
    5262 
    5363        def update(cls): 
    5464                dg.add_edge('a','b') 
    55  
    56         def print(cls): 
    57                 print dg.edges() 
     65         
     66        def print__TODO(cls): 
     67                print dg.edges()  
    5868 
    5969        def write(cls): 
     
    6373                dg = pickle.load(open('/tmp/graph.txt')) 
    6474 
    65     def __str__(self): 
    66         return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 
     75        def __str__(self): 
     76                return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 
    6777 
    6878class SimulationTrees(): 
    6979 
    70     def __init__(self,**kw): 
    71         self.sample=kw.get("sample",[]) 
     80        def __init__(self,**kw): 
     81                self.sample=kw.get("sample",[]) 
    7282 
    73     def __str__(self): 
    74         return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 
     83        def __str__(self): 
     84                return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 
Note: See TracChangeset for help on using the changeset viewer.