Skip to content
Snippets Groups Projects
trace.py 574 B
Newer Older
  • Learn to ignore specific revisions
  • Jarrod Pas's avatar
    Jarrod Pas committed
    from pydyton.core import Process, TickProcess
    
    class Trace(Process):
        def __init__(self, duration, nodes):
            Process.__init__(self)
    
            if duration < 1:
                raise ValueError('duration must be greater than or equal to 1')
            if nodes < 2:
                raise ValueError('nodes must be greater than or equal to 2')
    
            self.duration = duration
            self.nodes = nodes
    
    
    class TickTrace(Trace, TickProcess):
        def __init__(self, duration, nodes, tick):
            Trace.__init__(self, duration, nodes)
            TickProcess.__init__(self, tick)