Closed Gorkowski closed 8 months ago
so Aerosol could be something like
The Template Method Pattern could be employed to define the skeleton of an aerosol process algorithm, letting subclasses redefine certain steps of the algorithm without changing its structure. For instance, a generic AerosolProcess
class could outline steps common to coagulation, condensation, chemistry, and nucleation, while allowing specific details to be fleshed out by subclasses like CoagulationProcess
, CondensationProcess
, etc.
The Factory Method Pattern can facilitate the creation of objects without specifying the exact class of object that will be created. This is particularly useful for aerosol modeling, where different processes might be selected based on atmospheric conditions or other criteria. A ProcessFactory
could dynamically instantiate specific AerosolProcess
subclasses based on input parameters, enhancing the system's flexibility and adaptability.
Aerosol modeling processes could be structured as a series of runnable objects, where each process (e.g., coagulation, condensation) is encapsulated as a runnable that can be executed in sequence or parallel, depending on the model's requirements.
I was looking a LangChain, and I kind of like how they setup their process.
They have a template to generate runnable objects (or process), then compose them in a series, then evaluate the composed object. Each step can be modified, run, or composed in a different order.
From LangChain doc: https://github.com/langchain-ai/langchain/blob/master/libs/core/langchain_core/runnables/base.py """A sequence of runnables, where the output of each is the input of the next.