Skip to content

Commit e2587e0

Browse files
committed
2 parents 2c9e554 + 5751116 commit e2587e0

290 files changed

Lines changed: 16440 additions & 42436 deletions

File tree

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Sonar analysis and build
22
on:
33
push:
44
branches:

.github/workflows/docs.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
permissions:
8+
contents: write
9+
pages: write
10+
id-token: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: 3.x
20+
cache: 'pip'
21+
- run: pip install -r mkdocs-requirements.txt
22+
23+
- name: Set up JDK 21
24+
uses: graalvm/setup-graalvm@v1
25+
with:
26+
java-version: '21'
27+
distribution: 'graalvm'
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Cache Maven packages
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.m2
33+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
34+
restore-keys: ${{ runner.os }}-m2
35+
36+
- run: mvn compile javadoc:javadoc javadoc:aggregate
37+
- run: mkdocs build
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: site/
42+
43+
deploy:
44+
environment:
45+
name: github-pages
46+
url: ${{steps.deployment.outputs.page_url}}
47+
runs-on: ubuntu-latest
48+
needs: build
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,12 @@ hs_err_pid*
4141
target
4242
.DS_Store
4343

44-
venv
44+
venv
45+
46+
docs/apidocs
47+
solutions*
48+
results*
49+
log*
50+
.benchmark
51+
**/docs
52+
/example-graphs/instances/

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Developing
2+
3+
# v0.22
4+
- (Breaking) Simplify VNS implementation. New doc page for VNS.
25
- (Fix) Irace integration with v4.2
36
- (Fix) #228: Instance selector failed to copy instances if they were not in the root instance folder
7+
- (New) #129: New Excel serializer, allows users to extend the raw data and should have better performance in most cases.
48

59
# v0.21
610
- (New) Objective class: a class that represents an objective function of a problem. Each Objective has a name, a direction (minimize or maximize), and functions for extracting the value of the objective from Moves and from Solutions. See docs for a detailed description.

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs.mork-optimization.com

aggregate-report/pom.xml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,39 @@
1717
<dependency>
1818
<groupId>es.urjc.etsii.grafo</groupId>
1919
<artifactId>autoconfig</artifactId>
20-
<version>0.22-SNAPSHOT</version>
2120
</dependency>
2221
<dependency>
2322
<groupId>es.urjc.etsii.grafo</groupId>
2423
<artifactId>mork-common</artifactId>
25-
<version>0.22-SNAPSHOT</version>
2624
</dependency>
2725
<dependency>
2826
<groupId>es.urjc.etsii.grafo</groupId>
2927
<artifactId>mork</artifactId>
30-
<version>0.22-SNAPSHOT</version>
3128
</dependency>
3229
<dependency>
3330
<groupId>es.urjc.etsii.grafo</groupId>
34-
<artifactId>TSP</artifactId>
35-
<version>0.22-SNAPSHOT</version>
31+
<artifactId>tsp</artifactId>
32+
</dependency>
33+
<dependency>
34+
<groupId>es.urjc.etsii.grafo</groupId>
35+
<artifactId>graphs</artifactId>
36+
</dependency>
37+
<dependency>
38+
<groupId>es.urjc.etsii.grafo</groupId>
39+
<artifactId>bmssc</artifactId>
40+
</dependency>
41+
<dependency>
42+
<groupId>es.urjc.etsii.grafo</groupId>
43+
<artifactId>flayouts</artifactId>
44+
</dependency>
45+
<dependency>
46+
<groupId>es.urjc.etsii.grafo</groupId>
47+
<artifactId>vrpod</artifactId>
3648
</dependency>
3749
<dependency>
3850
<groupId>es.urjc.etsii.grafo</groupId>
3951
<artifactId>integration-tests</artifactId>
40-
<version>0.22-SNAPSHOT</version>
52+
<scope>test</scope>
4153
</dependency>
4254
</dependencies>
4355

@@ -46,7 +58,7 @@
4658
<plugin>
4759
<groupId>org.jacoco</groupId>
4860
<artifactId>jacoco-maven-plugin</artifactId>
49-
<version>0.8.12</version>
61+
<version>${mjacoco.version}</version>
5062
<executions>
5163
<execution>
5264
<id>jacoco-report-aggregate</id>

autoconfig/src/main/java/es/urjc/etsii/grafo/autoconfig/controller/AutoconfigDebugController.java

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import es.urjc.etsii.grafo.autoconfig.irace.IraceRuntimeConfiguration;
1111
import es.urjc.etsii.grafo.config.SolverConfig;
1212
import jakarta.servlet.http.HttpServletRequest;
13-
import org.springframework.context.annotation.Profile;
1413
import org.springframework.web.bind.annotation.GetMapping;
1514
import org.springframework.web.bind.annotation.RestController;
1615

@@ -72,11 +71,50 @@ public Object getInventory(){
7271
return this.inventory.getInventory();
7372
}
7473

74+
@GetMapping("/auto/debug/toIraceConfig/**")
75+
public Object toIraceConfig(HttpServletRequest request){
76+
String url = request.getRequestURI();
77+
String[] parts = url.split("/toIraceConfig/");
78+
if(parts.length != 2){
79+
return Map.of("error", "Invalid URL format. Expected format: /toIraceConfig/{commandLine}");
80+
}
81+
String cmdline = URLDecoder.decode(parts[1], StandardCharsets.UTF_8);
82+
cmdline = cleanCmdLine(cmdline);
83+
Map<String, String> params = extractParameters(cmdline);
84+
var line1 = new StringBuilder();
85+
var line2 = new StringBuilder();
86+
for(var entry: params.entrySet()){
87+
line1.append(entry.getKey()).append("\t");
88+
line2.append(entry.getValue()).append("\t");
89+
}
90+
return Map.of("iraceConfig", line1.toString().trim() + "\n" + line2.toString().trim());
91+
}
92+
93+
private static Map<String, String> extractParameters(String cmdline) {
94+
Map<String, String> params = new LinkedHashMap<>();
95+
for(var pair: cmdline.split("\\s+")) {
96+
if (pair.contains("=")) {
97+
var parts = pair.split("=");
98+
if (parts.length == 2) {
99+
params.put(parts[0], parts[1]);
100+
} else {
101+
throw new IllegalArgumentException("Invalid parameter format: " + pair);
102+
}
103+
} else {
104+
throw new IllegalArgumentException("Parameter without value: " + pair);
105+
}
106+
}
107+
return params;
108+
}
109+
75110
@GetMapping("/auto/debug/decode/**")
76111
public Object decode(HttpServletRequest request){
77112
String url = request.getRequestURI();
78-
String cmdline = url.split("/decode/")[1];
79-
cmdline = URLDecoder.decode(cmdline, StandardCharsets.UTF_8);
113+
String[] parts = url.split("/decode/");
114+
if(parts.length != 2){
115+
return Map.of("error", "Invalid URL format. Expected format: /toIraceConfig/{commandLine}");
116+
}
117+
String cmdline = URLDecoder.decode(parts[1], StandardCharsets.UTF_8);
80118
cmdline = cleanCmdLine(cmdline);
81119

82120
var config = cmdline.startsWith("ROOT")?

autoconfig/src/test/java/es/urjc/etsii/grafo/autoconfig/testutil/ComponentWhitelistDuringTesting.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package es.urjc.etsii.grafo.autoconfig.testutil;
22

33
import es.urjc.etsii.grafo.algorithms.SimpleAlgorithm;
4-
import es.urjc.etsii.grafo.algorithms.VNS;
4+
import es.urjc.etsii.grafo.algorithms.vns.VNS;
55
import es.urjc.etsii.grafo.algorithms.multistart.MultiStartAlgorithm;
66
import es.urjc.etsii.grafo.autoconfig.fakecomponents.*;
77
import es.urjc.etsii.grafo.autoconfig.inventory.WhitelistInventoryFilter;

autoconfig/src/test/resources/serializers.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ serializers:
5151
# Enable XLSX results serializer, set to false to skip serializing results to Excel 2007+
5252
enabled: true
5353

54-
# Defines how to handle calculated values when serializing to Excel 2007+
55-
# Possible values: java, excel, auto.
56-
calculationMode: auto
57-
5854
# When generating the pivot table, should algorithms be in rows or columns?
5955
# True: Instances per row, algorithms in columns
6056
# False: Algorithms in rows, instances in columns

common/src/main/java/es/urjc/etsii/grafo/algorithms/SimpleAlgorithm.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,24 @@ public SimpleAlgorithm(
6161
*/
6262
@Override
6363
public S algorithm(I instance) {
64+
var solution = constructive(instance);
65+
solution = localSearch(solution);
66+
return solution;
67+
}
68+
69+
/**
70+
* <p>Construct a solution first by calling the correct Java constructor and then
71+
* initialize it using the provided constructive method.</p>
72+
*
73+
* @param instance a I object.
74+
* @return a S object.
75+
*/
76+
protected S constructive(I instance) {
6477
var solution = this.newSolution(instance);
6578
solution = constructive.construct(solution);
6679
assert Context.validate(solution);
6780
Metrics.addCurrentObjectives(solution);
6881
printStatus("Constructive", solution);
69-
solution = localSearch(solution);
7082
return solution;
7183
}
7284

0 commit comments

Comments
 (0)