Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WolfGoatCabbage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OROBWorld
WolfGoatCabbage
Commits
e4813070
Commit
e4813070
authored
3 years ago
by
Paul A. Rubin
Browse files
Options
Downloads
Patches
Plain Diff
Renamed "Model" class "MIP".
parent
ee85a5f0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/wolfgoatcabbage/MIP.java
+3
-3
3 additions, 3 deletions
src/wolfgoatcabbage/MIP.java
src/wolfgoatcabbage/WolfGoatCabbage.java
+1
-1
1 addition, 1 deletion
src/wolfgoatcabbage/WolfGoatCabbage.java
with
4 additions
and
4 deletions
src/wolfgoatcabbage/M
odel
.java
→
src/wolfgoatcabbage/M
IP
.java
+
3
−
3
View file @
e4813070
...
...
@@ -5,7 +5,7 @@ import ilog.concert.IloNumVar;
import
ilog.cplex.IloCplex
;
/**
* M
odel
provides an optimization model to solve the logic puzzle.
* M
IP
provides an optimization model to solve the logic puzzle.
*
* The model captures trips between the "near" bank (starting point) and
* "far" bank (destination). At time 0, the farmer is on the near bank with
...
...
@@ -14,7 +14,7 @@ import ilog.cplex.IloCplex;
*
* @author Paul A. Rubin (rubin@msu.edu)
*/
public
final
class
M
odel
implements
AutoCloseable
{
public
final
class
M
IP
implements
AutoCloseable
{
// Item indices.
private
static
final
int
WOLF
=
0
;
private
static
final
int
GOAT
=
1
;
...
...
@@ -46,7 +46,7 @@ public final class Model implements AutoCloseable {
* Constructor.
* @throws IloException if the model instance cannot be created
*/
public
M
odel
()
throws
IloException
{
public
M
IP
()
throws
IloException
{
// Instantiate the model.
cplex
=
new
IloCplex
();
// Create the variables.
...
...
This diff is collapsed.
Click to expand it.
src/wolfgoatcabbage/WolfGoatCabbage.java
+
1
−
1
View file @
e4813070
...
...
@@ -18,7 +18,7 @@ public final class WolfGoatCabbage {
* @param args the command line arguments (ignored)
*/
public
static
void
main
(
final
String
[]
args
)
{
try
(
M
odel
model
=
new
M
odel
())
{
try
(
M
IP
model
=
new
M
IP
())
{
double
z
=
model
.
solve
();
System
.
out
.
println
(
"Optimal number of trips = "
+
z
+
"."
);
System
.
out
.
println
(
"Solution:"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment