Critical-Infrastructure-Systems-Lab / PowNet

PowNet: Network-constrained Unit Commitment / Economic Dispatch model in Python
MIT License
74 stars 26 forks source link

Streamline Solver Selection #15

Closed phumthep closed 2 weeks ago

phumthep commented 4 months ago

Issue Description

Currently, the Simulation class handles solver selection and instantiation directly, leading to some code duplication and potential for errors. The goal of this enhancement is to improve flexibility, maintainability, and testability by introducing a factory pattern to abstract solver interactions.

Current Workflow

Simulation class tightly coupled to Gurobipy The current implementation heavily relies on Gurobipy, making it difficult to switch or add new solvers seamlessly. There is also a temporary file creation: writing and deleting an MPS file for HiGHs introduces unnecessary overhead and potential I/O issues.

Proposed Solution

The idea is to adopt the Factory pattern.

Benefits of Factory Pattern

Additional Considerations:

phumthep commented 2 weeks ago

Closed with the following commits: