Fix raw metric handling
Change-Id: I7d867c7c28b081aae3799181f0634aa48565f0e5
This commit is contained in:
@@ -133,7 +133,7 @@ public class AMPLGenerator {
|
|||||||
out.println("# Metrics. Note that we only emit metrics that are in use. Values will be provided by the solver.");
|
out.println("# Metrics. Note that we only emit metrics that are in use. Values will be provided by the solver.");
|
||||||
out.println("## Raw metrics");
|
out.println("## Raw metrics");
|
||||||
for (final JsonNode m : app.getRawMetrics().values()) {
|
for (final JsonNode m : app.getRawMetrics().values()) {
|
||||||
String name = m.get("key").asText();
|
String name = m.get("name").asText();
|
||||||
if (usedMetrics.contains(name)) {
|
if (usedMetrics.contains(name)) {
|
||||||
out.format("param %s; # %s%n", name, m.get("name").asText());
|
out.format("param %s; # %s%n", name, m.get("name").asText());
|
||||||
}
|
}
|
||||||
@@ -141,9 +141,9 @@ public class AMPLGenerator {
|
|||||||
|
|
||||||
out.println("## Composite metrics");
|
out.println("## Composite metrics");
|
||||||
for (final JsonNode m : app.getCompositeMetrics().values()) {
|
for (final JsonNode m : app.getCompositeMetrics().values()) {
|
||||||
String name = m.get("key").asText();
|
String name = m.get("name").asText();
|
||||||
if (usedMetrics.contains(name)) {
|
if (usedMetrics.contains(name)) {
|
||||||
out.format("param %s; # %s%n", m.get("key").asText(), m.get("name").asText());
|
out.format("param %s; # %s%n", m.get("name").asText(), m.get("name").asText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.println();
|
out.println();
|
||||||
|
|||||||
Reference in New Issue
Block a user