Moved files to 'reactics-smt'

This commit is contained in:
Artur Meski
2019-03-03 22:26:00 +00:00
parent c3a19d81dc
commit 5eb8e3b63d
33 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
from rs.reaction_system_with_concentrations import ReactionSystemWithConcentrations
from rs.reaction_system_with_concentrations_param import ReactionSystemWithConcentrationsParam
from rs.context_automaton_with_concentrations import ContextAutomatonWithConcentrations
class ReactionSystemWithAutomaton(object):
def __init__(self, reaction_system, context_automaton):
self.rs = reaction_system
self.ca = context_automaton
def show(self, soft=False):
self.rs.show(soft)
self.ca.show()
def is_concentr_and_param_compatible(self):
"""
Checks if the underlying RS/CA are compatible
with parameters and concentrations
"""
if not isinstance(self.rs, ReactionSystemWithConcentrationsParam):
return False
if not isinstance(self.ca, ContextAutomatonWithConcentrations):
return False
return True
def is_with_concentrations(self):
if not isinstance(self.rs, ReactionSystemWithConcentrations):
return False
if not isinstance(self.ca, ContextAutomatonWithConcentrations):
return False
return True
def sanity_check(self):
pass
def get_ordinary_reaction_system_with_automaton(self):
if not self.is_with_concentrations():
raise RuntimeError("Not RS/CA with concentrations")
ors = self.rs.get_reaction_system()
oca = self.ca.get_automaton_with_flat_contexts(ors)
return ReactionSystemWithAutomaton(ors, oca)