diff --git a/klab.core.services/src/main/java/org/integratedmodelling/klab/runtime/temporary/Generators.java b/klab.core.services/src/main/java/org/integratedmodelling/klab/runtime/temporary/Generators.java index 3bceaf39..d54504d7 100644 --- a/klab.core.services/src/main/java/org/integratedmodelling/klab/runtime/temporary/Generators.java +++ b/klab.core.services/src/main/java/org/integratedmodelling/klab/runtime/temporary/Generators.java @@ -15,34 +15,18 @@ import org.integratedmodelling.klab.api.services.runtime.extension.Resolver; import org.integratedmodelling.klab.runtime.storage.DoubleStorage; -@Library(name = "klab.geospatial.generators", description = "Contextualizers that generate " + - "realistic-looking geographic " + - "terrains and features for stress-testing") +@Library(name = "klab.geospatial.generators", description = """ + Contextualizers that generate realistic-looking geographic terrains and features for stress-testing""") public class Generators { - @KlabFunction(name = "terrain", description = "Generate fractal surfaces within a user-defined range " + - "and with a " + - "configurable degree of smoothness, apt to simulating several terrain patterns such as " + - "elevation or slope" + - ". As the generator works in RAM, this should not be used on very large grids.", geometry = "S2", - type = Type.NUMBER, version = Version.CURRENT, + @KlabFunction(name = "terrain", description = """ + Generate fractal surfaces within a user-defined range \ + and with a configurable degree of smoothness, apt to simulating several terrain patterns such as \ + elevation or slope. As the generator works in RAM, this should not be used on very large grids.""", + geometry = "S2", type = Type.NUMBER, version = Version.CURRENT, parameters = { - @KlabFunction.Argument(name = "range", type = Type.RANGE, description = "The " + - "min-max range " + - "of the values produced. Default is 0 to 4000", optional = true), - @KlabFunction.Argument(name = "detail", type = Type.NUMBER, description = - "Controls the " + - "amount of detail in the generated structure. Default is 8, " + - "appropriate " + - "for " + - "elevation", optional = true), - @KlabFunction.Argument(name = "roughness", type = Type.NUMBER, description = - "Controls the " + - "roughness of the generated terrain. Default is 0.55, appropriate" + - " for " + - "elevation", - optional = true) - }) + @KlabFunction.Argument(name = "range", type = Type.RANGE, description = "The " + "min-max range " + "of the values produced. Default is 0 to 4000", optional = true), + @KlabFunction.Argument(name = "detail", type = Type.NUMBER, description = "Controls the " + "amount of detail in the generated structure. Default is 8, " + "appropriate " + "for " + "elevation", optional = true), @KlabFunction.Argument(name = "roughness", type = Type.NUMBER, description = "Controls the " + "roughness of the generated terrain. Default is 0.55, appropriate" + " for " + "elevation", optional = true)}) public static class FractalTerrain implements Resolver { @Override @@ -52,9 +36,7 @@ public void resolve(State state, ServiceCall call, ContextScope scope) { var xy = scope.getContextObservation().getGeometry().dimension(Dimension.Type.SPACE).getShape(); var storage = state.storage(DoubleStorage.class); var terrain = new Terrain(call.getParameters().get("detail", 8), call.getParameters().get( - "roughness" - , 0.55), - range.getLowerBound(), range.getUpperBound()); + "roughness", 0.55), range.getLowerBound(), range.getUpperBound()); /** appropriate pattern for generic scale when we handle only one dimension, even if in most diff --git a/klab.services.resolver/src/main/java/org/integratedmodelling/klab/services/resolver/ResolutionGraph.java b/klab.services.resolver/src/main/java/org/integratedmodelling/klab/services/resolver/ResolutionGraph.java index fdfdc8e8..2fee2836 100644 --- a/klab.services.resolver/src/main/java/org/integratedmodelling/klab/services/resolver/ResolutionGraph.java +++ b/klab.services.resolver/src/main/java/org/integratedmodelling/klab/services/resolver/ResolutionGraph.java @@ -148,7 +148,7 @@ public boolean merge(ResolutionGraph childGraph) { */ this.graph.addVertex(this.target); this.graph.addVertex(childGraph.target); - this.graph.addEdge(this.target, childGraph.target, new ResolutionEdge(childGraph.targetCoverage)); + this.graph.addEdge(this.target, childGraph.target, new ResolutionEdge(childGraph.targetCoverage, null)); /* ...by the amount determined in its coverage, "painting" the incoming extents onto ours. @@ -247,11 +247,12 @@ public List rootNodes() { public static class ResolutionEdge extends DefaultEdge { public Coverage coverage; + public String localName; public ResolutionEdge() { } - public ResolutionEdge(Coverage coverage) { + public ResolutionEdge(Coverage coverage, String localName) { this.coverage = coverage; } }