From 6ad84c8afd924393059b7cc4f0d9f97cf3e9796f Mon Sep 17 00:00:00 2001 From: alexjamesgarza Date: Fri, 1 Mar 2024 13:51:14 -0600 Subject: [PATCH] added params to reaction --- src/box_model.py | 1 + src/music_box_reaction.py | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/box_model.py b/src/box_model.py index c6cc2ae0..530b6823 100644 --- a/src/box_model.py +++ b/src/box_model.py @@ -199,5 +199,6 @@ def readFromJson(self): """ # TODO: Implement the logic to update the box model config using a json. pass + diff --git a/src/music_box_reaction.py b/src/music_box_reaction.py index 8d79c5a6..dd3b0942 100644 --- a/src/music_box_reaction.py +++ b/src/music_box_reaction.py @@ -9,22 +9,37 @@ class Reaction: reaction_type (str): The type of the reaction. reactants (List[Reactant]): A list of Reactant instances representing the reactants. Default is an empty list. products (List[Product]): A list of Product instances representing the products. Default is an empty list. + A (float): The A parameter for reaction rate. + B (float): The B parameter for reaction rate. + D (float): The D parameter for reaction rate. + E (float): The E parameter for reaction rate. + Ea (float): The activation energy (Ea) for the reaction. """ - def __init__(self, name, reaction_type, reactants=None, products=None): + def __init__(self, name=None, reaction_type=None, reactants=None, products=None, A=None, B=None, D=None, E=None, Ea=None): """ Initializes a new instance of the Reaction class. Args: - type (str): The type of the reaction. + name (str): The name of the reaction. reaction_type (str): The type of the reaction. reactants (List[Reactant]): A list of Reactant instances representing the reactants. Default is an empty list. products (List[Product]): A list of Product instances representing the products. Default is an empty list. + A (float): The A parameter for reaction rate. + B (float): The B parameter for reaction rate. + D (float): The D parameter for reaction rate. + E (float): The E parameter for reaction rate. + Ea (float): The activation energy (Ea) for the reaction. """ self.name = name self.reaction_type = reaction_type self.reactants = reactants if reactants is not None else [] self.products = products if products is not None else [] + self.A = A + self.B = B + self.D = D + self.E = E + self.Ea = Ea def add_reactant(self, reactant): """