Skip to content

Commit

Permalink
added params to reaction
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjamesgarza committed Mar 1, 2024
1 parent 55815eb commit 6ad84c8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/box_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,6 @@ def readFromJson(self):
"""
# TODO: Implement the logic to update the box model config using a json.
pass



19 changes: 17 additions & 2 deletions src/music_box_reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 6ad84c8

Please sign in to comment.