# Copyright (c) 2015 Michele Volpato # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. import os,sys,inspect # Include project dir in path currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.append(parentdir) print(parentdir) from systems.implementations import InputOutputLTS inputs = set([1,2]) outputs = set(['a','b']) quiescence = 'delta' I3 = InputOutputLTS(2, inputs, outputs, quiescence) I3.addTransition(1,1,0) I3.addTransition(1,2,0) I3.addTransition(0,1,0) I3.addTransition(0,2,1) inputs = set([1,'c']) outputs = set(['a','b']) quiescence = 'delta' I4 = InputOutputLTS(3, inputs, outputs, quiescence) I4.isInputEnabled() I4.move(2) I3.isInputEnabled() inputs = set(['a','b']) outputs = set(['x','y']) quiescence = 'delta' I1=InputOutputLTS(8, inputs, outputs, quiescence) I1.addTransition(0,'a',1) I1.addTransition(0,'a',2) I1.addTransition(0,'b',0) I1.addTransition(1,'a',0) I1.addTransition(1,'b',3) I1.addTransition(2,'a',0) I1.addTransition(2,'b',3) I1.addTransition(2,'x',4) I1.addTransition(3,'a',0) I1.addTransition(3,'x',4) I1.addTransition(3,'b',3) I1.addTransition(4,'y',2) I1.addTransition(4,'b',4) I1.addTransition(4,'a',0) I1.move('a') print(I1.currentState()) I1.isInputEnabled()