diff options
author | 2017-07-13 14:16:59 +0200 | |
---|---|---|
committer | 2017-07-13 14:16:59 +0200 | |
commit | b8694fcd581b19161f72f0da288bf72e922455a8 (patch) | |
tree | f760dc03812cf5327243d1fcedc24b96f58c583d /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner | |
parent | The test runners now ignore every folder beginning with "output*" (diff) | |
download | VIATRA-Generator-b8694fcd581b19161f72f0da288bf72e922455a8.tar.gz VIATRA-Generator-b8694fcd581b19161f72f0da288bf72e922455a8.tar.zst VIATRA-Generator-b8694fcd581b19161f72f0da288bf72e922455a8.zip |
Repaired dependency
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner')
2 files changed, 6 insertions, 2 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/PartialInterpretation2Graphviz.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/PartialInterpretation2Graphviz.xtend index a4baeadb..81dd97b1 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/PartialInterpretation2Graphviz.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/PartialInterpretation2Graphviz.xtend | |||
@@ -33,6 +33,8 @@ import guru.nidi.graphviz.engine.Engine | |||
33 | import guru.nidi.graphviz.attribute.Records | 33 | import guru.nidi.graphviz.attribute.Records |
34 | import guru.nidi.graphviz.attribute.Attributes | 34 | import guru.nidi.graphviz.attribute.Attributes |
35 | import java.util.List | 35 | import java.util.List |
36 | import guru.nidi.graphviz.engine.GraphvizEngine | ||
37 | import guru.nidi.graphviz.engine.GraphvizV8Engine | ||
36 | 38 | ||
37 | class GraphvizVisualisation implements PartialInterpretationVisualiser { | 39 | class GraphvizVisualisation implements PartialInterpretationVisualiser { |
38 | 40 | ||
@@ -196,7 +198,7 @@ class GraphvizVisualisation implements PartialInterpretationVisualiser { | |||
196 | } | 198 | } |
197 | protected def typePredicateColor(Set<Type> types) { types.averageColor } | 199 | protected def typePredicateColor(Set<Type> types) { types.averageColor } |
198 | protected def typePredicateColor(String name) { | 200 | protected def typePredicateColor(String name) { |
199 | val Random random = new Random(name.hashCode+1) | 201 | val Random random = new Random(name.hashCode) |
200 | val rangePicker = [|random.nextInt(128)+128] | 202 | val rangePicker = [|random.nextInt(128)+128] |
201 | return #[rangePicker.apply(), rangePicker.apply(), rangePicker.apply()] | 203 | return #[rangePicker.apply(), rangePicker.apply(), rangePicker.apply()] |
202 | } | 204 | } |
@@ -232,6 +234,7 @@ class GraphvisVisualisation implements PartialInterpretationVisualisation { | |||
232 | 234 | ||
233 | override writeToFile(ReasonerWorkspace workspace, String name) { | 235 | override writeToFile(ReasonerWorkspace workspace, String name) { |
234 | val path = '''«workspace.workspaceURI.toFileString»/«name».png''' | 236 | val path = '''«workspace.workspaceURI.toFileString»/«name».png''' |
237 | Graphviz.useEngine(new GraphvizV8Engine()); | ||
235 | Graphviz.fromGraph(graph)//.engine(Engine::NEATO) | 238 | Graphviz.fromGraph(graph)//.engine(Engine::NEATO) |
236 | .render(Format.PNG).toFile(new File(path)); | 239 | .render(Format.PNG).toFile(new File(path)); |
237 | } | 240 | } |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/Test.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/Test.xtend index 75187c26..428973a4 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/Test.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/Test.xtend | |||
@@ -7,7 +7,8 @@ import org.eclipse.emf.ecore.resource.Resource | |||
7 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl | 7 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl |
8 | 8 | ||
9 | class Test { | 9 | class Test { |
10 | def static void main(String[] args) { | 10 | def static void main(String[] args) { |
11 | println("xxx") | ||
11 | val workspace = new FileSystemWorkspace("input/","") | 12 | val workspace = new FileSystemWorkspace("input/","") |
12 | 13 | ||
13 | PartialinterpretationPackage.eINSTANCE.eClass | 14 | PartialinterpretationPackage.eINSTANCE.eClass |