Esempio n. 1
0
    def __init__(self, spec):
        self.spec = spec
        generator = None

        if self.spec.language == Language.PYTHON:
            if self.spec.time_interpretation == TimeInterpretation.DISCRETE:
                from rtamt.evaluator.stl.discrete_time.online.python.online_discrete_time_python_monitor import \
                    STLOnlineDiscreteTimePythonMonitor
                generator = STLOnlineDiscreteTimePythonMonitor()
            elif self.spec.time_interpretation == TimeInterpretation.DENSE:
                from rtamt.evaluator.stl.dense_time.online.python.online_dense_time_python_monitor import \
                    STLOnlineDenseTimePythonMonitor
                generator = STLOnlineDenseTimePythonMonitor()
        elif self.spec.language == Language.CPP:
            from rtamt.evaluator.stl.discrete_time.online.cpp.online_discrete_time_cpp_monitor import \
                STLOnlineDiscreteTimeCPPMonitor
            generator = STLOnlineDiscreteTimeCPPMonitor()

        if generator is None:
            raise STLNotImplementedException(
                'The monitor with discrete_time interptetation,'
                'online deployment and {} implementation is not '
                'available in this version '
                'of the library'.format(self.spec.language))

        self.node_monitor_dict = generator.generate(self.spec.top)
 def visitTimedUntil(self, node, args):
     raise STLNotImplementedException(
         'Bounded until operator not implemented in STL online monitor.')
 def visitTimedEventually(self, node, args):
     raise STLNotImplementedException(
         'Bounded eventually operator not implemented in STL online monitor.'
     )
 def visitTimedAlways(self, node, args):
     raise STLNotImplementedException(
         'Bounded always operator not implemented in STL online monitor.')
 def visitNext(self, node, args):
     raise STLNotImplementedException(
         'Next operator not implemented in STL online monitor.')
 def visitUntil(self, node, args):
     raise STLNotImplementedException(
         'Until operator is not implemented in the STL online monitor.')
 def visitTimedPrecedes(self, node, args):
     raise STLNotImplementedException(
         'Precedes operator not implemented in STL dense-time monitor.')
 def visitFall(self, node, args):
     raise STLNotImplementedException(
         'Fall operator not implemented in STL dense monitor.')