Title: CoJava: Optimization Modeling by Nondeterministic Simulation
1CoJava Optimization Modeling by Nondeterministic
Simulation
- Alex Brodsky
- George Mason University and
- Adaptive Decisions, Inc.
- Joint work with
- Hadon Nash
- Google
2Presentation Outline
- Optimization vs. Simulation Modeling
- CoJava by Example A Simple Supply Chain
- CoJava Syntax and Restrictions
- Semantics Optimal Execution Path
- Reduction to Constraint Optimization Formulation
- Implementation
- Related Work
- Conclusions and Future Work
3Optimization vs. Simulation Models
4Presentation Outline
- Optimization vs. Simulation Modeling
- CoJava by Example A Simple Supply Chain
- CoJava Syntax
- Semantics Optimal Execution Path
- Reduction to Constraint Optimization Formulation
- Implementation
- Related Work
- Conclusions and Future Work
5Presentation Outline
- Optimization vs. Simulation Modeling
- CoJava by Example A Simple Supply Chain
- CoJava Syntax
- Semantics Optimal Execution Path
- Reduction to Constraint Optimization Formulation
- Implementation
- Related Work
- Conclusions and Future Work
6CoJava Syntax
public class Nd public double choice(double
min, double max) ... public double
checkMinObjective(double objective) ...
public double checkMaxObjective(double objective)
...
CoJava program can compile and run in Java!
7CoJava Syntax Restrictions
- Non-deterministic value
- The output of a choice method is a ND-value
- A variable is a ND-value, if it appears on the
left-hand side of an assignment with a ND-value
on the right-hand side. - A variable is a ND-value, if it appears on
the left-hand side of an assignment that
appears in the THEN or ELSE part of a conditional
statement, where the Boolean condition is a
ND-value. - The result of an arithmetic or Boolean
operation on one or more ND- values is a
ND-value.
- Syntactic restrictions
- No ND loops
- No ND recursive method calls
- No ND calls for checkObjective.
8Presentation Outline
- Optimization vs. Simulation Modeling
- CoJava by Example A Simple Supply Chain
- CoJava Syntax
- Semantics Optimal Execution Path
- Reduction to Constraint Optimization Formulation
- Implementation
- Related Work
- Conclusions and Future Work
9CoJava Semantics Optimal Execution Path
Given P - CoJava program I - input to
P v - variable in checkMin/MaxObjective(v),
which appears once in P We denote by EP -
the set of all feasible execution paths e, i.e.,
execution paths that reach the
statement checkMin/MaxObjective(v) when P is run
on input I v(e) - the value of program
variable v at checkMin/MaxObjective(v) on
feasible execution path e in
EP We define optimal execution path OP as a
solution to the problem
min/max v(e) subject to e in EP
10CoJava Semantics 2 step process
- Case 1 A single checkMin/MaxObjective in program
P - Step 1 Find an optimal execution path OP for P
on input I - Step 2 Execute OP deterministically as a
regular Java program
- Case 2 No checkMin/MaxObjective in program P
- Step 1 Find a feasible execution path e for P
on input I - Step 2 Execute e deterministically as a
regular Java program
11CoJava Semantics
- Case 3 Multiple checkMin/MaxObjective in
program P - Apply Case 1 iteratively
12Presentation Outline
- Optimization vs. Simulation Modeling
- CoJava by Example A Simple Supply Chain
- CoJava Syntax
- Semantics Optimal Execution Path
- Reduction to Constraint Optimization Formulation
- Implementation
- Related Work
- Conclusions and Future Work
13Reduction to Constraint Optimization
FormulationSmall Example
CS prices0_1 gt 100.0 /\ prices0_1 lt
200.0 /\ prices1_1 gt 105.0 /\ prices0_2 lt
205.0 .. ... ... revenue_1 0 /\ revenue_2
revenue_1 revenues0_2 /\ . revenue_3
revenue_2 revenues1_2 /\ . cost_3 cost_1
cost_2 /\ . profit_1 revenue_3 - cost_3 /\
Maximize profit_1 subject to CS
prices0 Nd.choice(100, 200) prices1
Nd.choice(105, 205) Demand demand new
Demand(prices) Manufacturer manufacturer new
Manufacturer(demand.quantities) Supplier
supplier new Supplier(manufacturer.materials)
double revenue 0 for (int i 0 i lt
2 i i 1) revenue
demand.revenuesi double cost
manufacturer.cost supplier.cost double profit
revenue - cost Nd.checkMaxObjective(profit)
14Reduction to Constraint Optimization
FormulationAnother Small Example
CS . prices0_1 gt 100 /\ prices_1 lt
200 /\ quantities0_1 1000 /\ revenues0_1
prices0_1 1000 /\ (prices0_1 lt 150) ---gt
(quantities0_2 4000 /\ revenues0_2
prices_1 4000) (prices_1 lt 150)
---gt (quantities0_2 quantities0_1 /\
revenues0_2 revenues0_1) . / Similar
for second iteration /
final double pLow 100, 105 final
double pMid 150, 185 final double
pHigh 200, 205 final double qLow
4000, 6000 final double qHigh 1000,
1800 for (int i 0 i lt 2 i i 1)
assert(pricesi gt pLowi)
assert(pricesi lt pHighi)
quantitiesi qHighi revenuesi
pricesi qHighi if (pricesi
lt pMidi) quantitiesi
qLowi revenuesi pricesi
qLowi
15Presentation Outline
- Optimization vs. Simulation Modeling
- CoJava by Example A Simple Supply Chain
- CoJava Syntax
- Semantics Optimal Execution Path
- Reduction to Constraint Optimization Formulation
- Implementation
- Related Work
- Conclusions and Future Work
16Presentation Outline
- Optimization vs. Simulation Modeling
- CoJava by Example A Simple Supply Chain
- CoJava Syntax
- Semantics Optimal Execution Path
- Reduction to Constraint Optimization Formulation
- Implementation
- Related Work See Paper for Details
- Conclusions and Future Work
17Conclusions and Future Work
- Unified language for process simulation and
optimization - Java was used, but this is a general framework
for Optimization extensions of - process models in PL, DB QL, CAD/CAM, workflow
systems, - This allows to push MP and CP to other
communities of users without them realizing
they are using it, because they would continue to
use their native methodologies/tools/systems - Future research questions
- how to generalize CoJava to serve as a general
computational paradigm - how to extend it with intelligent debugging
capability (including testing whether
generated constraints fall into specific classes
supported by external solvers) - how to extend CoJava with CP facilities and
extend underlying constraint solvers - how to apply CoJava principle to optimize
processes in diverse domain, such as a variety of
CAD/CAM methodologies and tools - how to extend CoJava for specifying
templates for machine learning (regression and
classification models)