Cleaning up rs/

This commit is contained in:
Artur Meski
2019-02-23 13:06:42 +00:00
parent df19367659
commit 59cbc00e7f
9 changed files with 15 additions and 69 deletions

View File

@@ -10,3 +10,5 @@ from rs.extended_context_automaton import ExtendedContextAutomaton
from rs.network_of_context_automata import NetworkOfContextAutomata from rs.network_of_context_automata import NetworkOfContextAutomata
from rs.reaction_system_with_automaton import ReactionSystemWithAutomaton from rs.reaction_system_with_automaton import ReactionSystemWithAutomaton
from rs.reaction_system_with_autnet import ReactionSystemWithNetworkOfAutomata from rs.reaction_system_with_autnet import ReactionSystemWithNetworkOfAutomata
# EOF

View File

@@ -162,3 +162,4 @@ class ContextAutomaton(object):
self.show_transitions() self.show_transitions()
self.show_prod_entities() self.show_prod_entities()
# EOF

View File

@@ -67,3 +67,4 @@ class ContextAutomatonWithConcentrations(ContextAutomaton):
self.show_states() self.show_states()
self.show_transitions() self.show_transitions()
# EOF

View File

@@ -165,3 +165,4 @@ class ExtendedContextAutomaton(ContextAutomaton):
super(ExtendedContextAutomaton, self).show() super(ExtendedContextAutomaton, self).show()
self.show_actions() self.show_actions()
# EOF

View File

@@ -102,3 +102,4 @@ class NetworkOfContextAutomata(object):
self.show_prod_entities() self.show_prod_entities()
self.show_actions() self.show_actions()
# EOF

View File

@@ -192,3 +192,5 @@ class ReactionSystem(object):
if self.background_set == []: if self.background_set == []:
print("Empty background set") print("Empty background set")
exit(1) exit(1)
# EOF

View File

@@ -9,3 +9,4 @@ class ReactionSystemWithNetworkOfAutomata(object):
self.rs.show(soft) self.rs.show(soft)
self.cas.show() self.cas.show()
# EOF

View File

@@ -402,12 +402,5 @@ class ReactionSystemWithAutomaton(object):
return ReactionSystemWithAutomaton(ors, oca) return ReactionSystemWithAutomaton(ors, oca)
# class ReactionSystemWithConcentrationWithAutomaton(ReactionSystemWithAutomaton): # EOF
#
# 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()

View File

@@ -97,7 +97,6 @@ class ReactionSystemWithConcentrationsParam(ReactionSystem):
def get_state_ids(self, state): def get_state_ids(self, state):
"""Returns entities of the given state without levels""" """Returns entities of the given state without levels"""
# return [e for e,c in state]
return [self.get_entity_id(e) for e in state] return [self.get_entity_id(e) for e in state]
def has_non_zero_concentration(self, elem): def has_non_zero_concentration(self, elem):
@@ -425,59 +424,4 @@ class ReactionSystemWithConcentrationsParam(ReactionSystem):
return rs return rs
# EOF
# 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):
# """
# Checks if the underlying RS and CA provide
# concentration levels
# """
# 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)
#
# class ReactionSystemWithConcentrationWithAutomaton(ReactionSystemWithAutomaton):
#
# 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()