-
Notifications
You must be signed in to change notification settings - Fork 18
Feat: set OptSolvX
as default LP backend; add SBML-FBC→LP bridge prototype
#90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xts-Michi
wants to merge
22
commits into
draeger-lab:master
Choose a base branch
from
xts-Michi:feat/optsolvx-default
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
aba00c6
feat(optsolvx): add OptSolvXAdapter with model validation and debug l…
xts-Michi be38d5c
feat(optsolvx): add working demo
xts-Michi 1c63b82
test(optsolvx): add JUnit test for OptSolvXSolverAdapter (build check…
xts-Michi 36e4b99
Updated README with OptSolvX User Guide
xts-Michi 6ac8cc0
test: added more tests
xts-Michi e72f950
feat: added better error handling and a timer to track the time while…
xts-Michi c8edbe4
feat: add SBML to OptSolvX bridge skeleton (FbaToOptSolvX)
xts-Michi ae03792
feat(sbscl): harden OptSolvXSolverAdapter (final + null-check + 1-arg…
xts-Michi f2afc17
feat(sbscl-bridge): add FbaToOptSolvX to map SBML/FBC (reactions, bou…
xts-Michi a64d24c
feat(sbscl): add OptSolvX bridge skeleton (FbaToOptSolvX) + smoke/obj…
xts-Michi 6c7e239
docs(README): add “Using OptSolvX” section (demo, debug flag) and not…
xts-Michi d9bdc0c
feat(fba): switch default LP backend to OptSolvX (FBA only)
xts-Michi 2976e25
build(pom), docs(readme): exclude legacy XML parsers & add troublesho…
xts-Michi 902f796
refactor(fba): remove unused epsilon field and accessors
xts-Michi d940dbd
perf(sbscl-bridge): cache SBML lists/ids and pre-size maps to avoid r…
xts-Michi 72e3e2c
fix(sbscl): add Commons Math 2.x dependency for legacy ODE API
xts-Michi 84c7303
fix(fba): restore getActiveObjective() for API/test compatibility
xts-Michi 5ea0c98
test(optsolvx): add BridgeConstraintTests for S·v=0 (counts, signs/va…
xts-Michi 774280c
refactor(fba): remove legacy SCPSolver/GLPK backend (NewGLPKSolver + …
xts-Michi d137a9b
docs(README): Updated a small fix
xts-Michi 08fbb93
style: reformat codebase for consistency (no functional changes)
xts-Michi a252828
refactor(demo): use OptSolvXConfig for backend resolution; drop hardc…
xts-Michi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.simulator.optsolvx; | ||
|
||
public class OptSolvXDemo { | ||
public static void main(String[] args) { | ||
|
||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/main/java/org/simulator/optsolvx/OptSolvXSolverAdapter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.simulator.optsolvx; | ||
|
||
import org.optsolvx.model.AbstractLPModel; | ||
import org.optsolvx.solver.LPSolution; | ||
import org.optsolvx.solver.LPSolverAdapter; | ||
|
||
import java.text.MessageFormat; | ||
import java.util.logging.Logger; | ||
|
||
public class OptSolvXSolverAdapter implements LPSolverAdapter { | ||
private static final Logger LOGGER = | ||
Logger.getLogger(OptSolvXSolverAdapter.class.getName()); | ||
|
||
private final LPSolverAdapter backend; | ||
private final boolean debug; | ||
|
||
/** | ||
* @param backend concrete OptSolvX solver (e.g. CommonsMathSolver) | ||
* @param debug enable verbose logging | ||
*/ | ||
public OptSolvXSolverAdapter(LPSolverAdapter backend, boolean debug) { | ||
this.backend = backend; | ||
this.debug = debug; | ||
} | ||
|
||
@Override | ||
public LPSolution solve(AbstractLPModel model) { | ||
if (!model.isBuilt()) { | ||
throw new IllegalStateException("Model must be built() before solving."); | ||
} | ||
|
||
if (debug) { | ||
LOGGER.info(MessageFormat.format( | ||
"{0}: solving with {1} (vars={2}, cons={3})", | ||
getClass().getSimpleName(), | ||
backend.getClass().getSimpleName(), | ||
model.getVariables().size(), | ||
model.getConstraints().size() | ||
)); | ||
} | ||
|
||
LPSolution sol = backend.solve(model); | ||
|
||
if (debug) { | ||
LOGGER.info(MessageFormat.format( | ||
"{0}: result feasible={1}, objective={2}", | ||
getClass().getSimpleName(), | ||
sol.isFeasible(), | ||
sol.getObjectiveValue() | ||
)); | ||
} | ||
|
||
return sol; | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please place a local lib file of OptSolvX and use a local dependency for the time being, until we have it in MavenCentral.