Skip to content

Commit c668872

Browse files
committed
Merge branch 'release/1.3.0'
2 parents f1ce306 + 3b1618e commit c668872

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1495
-210
lines changed

README.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@ To get up to speed, the easiest way to start with this library is to study the e
1818
* src/examples/mp: examples of optimization models based on mathematical programming
1919
* src/examples/cp: examples of optimization models based on constraint programming
2020

21-
This library has been tested using IBM ILOG CPLEX 12.6.3 and 12.7.0, Scala 2.11.8 and Java JDK 1.8.0_121. If you want
22-
to play with this library and do not have a license of CPLEX, you can download
23-
[IBM ILOG CPLEX Optimization Studio Community Edition](https://www-01.ibm.com/software/websphere/products/optimization/cplex-studio-community-edition/)
21+
This library has been tested using IBM ILOG CPLEX 12.8, Scala 2.12.6 and Java JDK 1.8.0_161 on Windows 10
22+
64 bits. Port to 32 bits or Linux should be fairly easy, see file `build.gradle`. Last revision compatible with
23+
IBM ILOG Decision Optimization Center 3.9 is release 1.2.0 (Java 6, Scala 2.11.8)
2424

25-
To build the library install gradle 2.10 and set the environment variable `CPLEX_STUDIO_HOME` (e.g.
26-
on windows `C:\IBM\ILOG\CPLEX_Studio127`).
25+
If you want to play with this library and do not have a license of CPLEX, you can download the
26+
[Community Edition of IBM ILOG CPLEX Optimization Studio](https://www-01.ibm.com/software/websphere/products/optimization/cplex-studio-community-edition/)
27+
28+
To build this library use the Gradle wrapper provided or install [Gradle 2.10](https://gradle.org) and set the environment variable `CPLEX_STUDIO_HOME` (e.g.
29+
on windows `C:\IBM\ILOG\CPLEX_Studio128`).
2730

2831
Then do:
2932

3033
```
31-
$ gradle build
34+
$ ./gradlew build
3235
```
3336

3437
This will create the scala library in directory `build/libs`.
@@ -37,15 +40,29 @@ This will create the scala library in directory `build/libs`.
3740
To run the tests, do:
3841

3942
```
40-
$ gradle test
43+
$ ./gradlew test
4144
```
4245

4346
Reports are generated in directory `build/reports/tests`.
4447

4548
To generate the scala docs, do:
4649

4750
```
48-
$ gradle scaladoc
51+
$ ./gradlew scaladoc
52+
```
53+
54+
The scala documentation is generated in directory `build/docs/scaladoc`.
55+
56+
To clean and rebuild the library, do:
57+
58+
```
59+
$ ./gradlew clean build
4960
```
5061

51-
The scala documentation is generated in directory `build/docs/scaladoc`.
62+
For a complete list of Gradle tasks, do:
63+
64+
```
65+
$ ./gradlew tasks
66+
```
67+
68+

RELEASENOTES.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
1+
# Release Notes of cplex-scala: A Scala library for IBM ILOG CPLEX
2+
3+
## cplex-scala v1.3.0
4+
5+
* Functional programming: add iterators for cumul function expression, state function, step function and piecewise
6+
linear function. Furthermore, these functions are now iterables and this allow to iterate like
7+
this:
8+
```scala
9+
val f = model.numToNumStepFunction()
10+
...
11+
for (s <- f) {
12+
println("[" + s.start + " .. " + s.end + ") -> " + s.value)
13+
}
14+
```
15+
* Add type `IntSet`, factory methods and iterator.
16+
* Add scala API for inverse constraint and add example `Talent.scala`.
17+
* Port to CPLEX 12.8
18+
* Port to Scala 2.12.6
19+
* Add new signature for method alternative with only two parameters
20+
* Add method getFirst, getLast, getNext and getPrev in class CpModel to get rescpectively the first interval variable
21+
in the sequence, the last interval variable in the sequence, the next interval variable in the sequence, the previous
22+
interval variable in the sequence.
23+
* IntervalSequenceVariable is now a proper class. It implements the Trait Iterable: one can write something like this:
24+
```scala
25+
val seq = model.intervalSequenceVar()
26+
...
27+
for (x <- seq) {
28+
System.out.println(model.getDomain(x))
29+
}
30+
```
31+
* Add example SchedSetup: a scheduling problem on two alternative heterogeneous machines with sequence dependent setup
32+
times and forbidden transisions
33+
34+
135
## cplex-scala v1.2.0
236

37+
### README
38+
39+
* Add a link to IBM ILOG CPLEX Studio Community Edition download page in the README
40+
341
### Constraint Programming
442

543
* Add state function
@@ -8,7 +46,6 @@
846
* Add missing precedence constraints in companion object of CpModel
947
* Add constraints `alwaysEqual` on cumul functions
1048
* Add integer division on integer expression
11-
* Add a link to IBM ILOG CPLEX Studio Community Edition download page in the README
1249

1350
## cplex-scala v1.1.0
1451

build.gradle

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
/*
2+
* Source file provided under Apache License, Version 2.0, January 2004,
3+
* http://www.apache.org/licenses/
4+
* (c) Copyright DecisionBrain SAS 2016,2017
5+
*/
6+
17
group 'com.decisionbrain'
2-
version '1.2.0'
8+
version '1.3.0'
39

410
apply plugin: 'java'
511
apply plugin: 'scala'
@@ -61,10 +67,10 @@ configurations.all {
6167
sourceSets {
6268
main {
6369
java {
64-
srcDirs = ['src/main/java']
70+
srcDirs = ['src/main/java', 'src/examples/java']
6571
}
6672
scala {
67-
srcDirs = ['src/main/scala']
73+
srcDirs = ['src/main/scala', 'src/examples/scala']
6874
}
6975
resources {
7076
srcDir 'src/main/resources'
@@ -75,7 +81,7 @@ sourceSets {
7581
srcDirs = ['src/test/java']
7682
}
7783
scala {
78-
srcDirs = ['src/test/scala', 'src/examples/scala']
84+
srcDirs = ['src/test/scala']
7985
}
8086
resources {
8187
srcDir 'src/test/resources'
@@ -126,16 +132,16 @@ javadoc {
126132
}
127133

128134
ext {
129-
scalaVersion = '2.11.8'
130-
scalaVersionShort = '2.11'
135+
scalaVersion = '2.12.6'
136+
scalaVersionShort = '2.12'
131137
}
132138

133139
dependencies {
134140
compile fileTree(dir: cplexStudioHome + "/opl/lib", include: ['*.jar'])
135141

136142
compile 'org.slf4j:slf4j-api:1.7.10'
137143
compile 'commons-lang:commons-lang:2.6'
138-
compile('org.scala-lang:scala-library:2.11.8')
144+
compile('org.scala-lang:scala-library:2.12.6')
139145

140146
testCompile "org.hamcrest:hamcrest-core:1.3"
141147
testCompile "org.hamcrest:hamcrest-library:1.3"
@@ -154,7 +160,7 @@ task listJars << {
154160
}
155161

156162
task wrapper(type: Wrapper) {
157-
gradleVersion = '2.10'
163+
gradleVersion = '4.8.1'
158164
description = 'Install Gradle Wrapper'
159165
}
160166

data/rehearsal.data

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
5 1 1 1 1 1
2+
9 2 4 1 3 3 2 5 7 6
3+
1 1 0 1 0 1 1 0 1
4+
1 1 0 1 1 1 0 1 0
5+
1 1 0 0 0 0 1 1 0
6+
1 0 0 0 1 1 0 0 1
7+
0 0 1 0 1 1 1 1 0
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
#
2-
# Source file provided under Apache License, Version 2.0, January 2004,
3-
# http://www.apache.org/licenses/
4-
# (c) Copyright DecisionBrain SAS 2016,2017
5-
#
6-
7-
#Sat Feb 04 16:30:34 CET 2017
1+
#Tue Jun 26 19:12:53 CEST 2018
82
distributionBase=GRADLE_USER_HOME
93
distributionPath=wrapper/dists
104
zipStoreBase=GRADLE_USER_HOME
115
zipStorePath=wrapper/dists
12-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip

src/examples/scala/com/decisionbrain/cplex/cp/Color.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Source file provided under Apache License, Version 2.0, January 2004,
33
* http://www.apache.org/licenses/
4-
* (c) Copyright DecisionBrain SAS 2016,2017
4+
* (c) Copyright DecisionBrain SAS 2016,2018
55
*/
66

77
package com.decisionbrain.cplex.cp
@@ -50,9 +50,8 @@ object Color {
5050

5151
if (status) {
5252
println(s"Solution status: $status")
53-
for (country <- countries.toList) {
53+
for (country <- countries) {
5454
println("\t" + country + ": " + allColors(model.getValue(colors(country))))
55-
// println(c)
5655
}
5756
}
5857

src/examples/scala/com/decisionbrain/cplex/cp/Facility.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Source file provided under Apache License, Version 2.0, January 2004,
33
* http://www.apache.org/licenses/
4-
* (c) Copyright DecisionBrain SAS 2016,2017
4+
* (c) Copyright DecisionBrain SAS 2016,2018
55
*/
66

77
package com.decisionbrain.cplex.cp

src/examples/scala/com/decisionbrain/cplex/cp/Golomb.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Source file provided under Apache License, Version 2.0, January 2004,
33
* http://www.apache.org/licenses/
4-
* (c) Copyright DecisionBrain SAS 2016,2017
4+
* (c) Copyright DecisionBrain SAS 2016,2018
55
*/
66

77
package com.decisionbrain.cplex.cp

src/examples/scala/com/decisionbrain/cplex/cp/HouseBuilding.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
/*
22
* Source file provided under Apache License, Version 2.0, January 2004,
33
* http://www.apache.org/licenses/
4-
* (c) Copyright DecisionBrain SAS 2016,2017
4+
* (c) Copyright DecisionBrain SAS 2016,2018
55
*/
66

77
package com.decisionbrain.cplex.cp
88

9-
import ilog.concert.IloIntervalVar
10-
119
import com.decisionbrain.cplex.cp.CpModel._
1210

1311

src/examples/scala/com/decisionbrain/cplex/cp/SchedCalendar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Source file provided under Apache License, Version 2.0, January 2004,
33
* http://www.apache.org/licenses/
4-
* (c) Copyright DecisionBrain SAS 2016,2017
4+
* (c) Copyright DecisionBrain SAS 2016,2018
55
*/
66

77
package com.decisionbrain.cplex.cp

0 commit comments

Comments
 (0)