diff options
author | 2020-07-08 02:33:06 +0200 | |
---|---|---|
committer | 2020-07-08 02:33:06 +0200 | |
commit | b0e3359574eb00e1eaab5a7286a6f8e163b7b87f (patch) | |
tree | 64632b059e57819cd982a4cc3abafb421e27fd79 /Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse | |
parent | Restore inverse punishSize (diff) | |
download | VIATRA-Generator-b0e3359574eb00e1eaab5a7286a6f8e163b7b87f.tar.gz VIATRA-Generator-b0e3359574eb00e1eaab5a7286a6f8e163b7b87f.tar.zst VIATRA-Generator-b0e3359574eb00e1eaab5a7286a6f8e163b7b87f.zip |
Fix event storm on EMF transaction finish
Diffstat (limited to 'Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse')
2 files changed, 24 insertions, 3 deletions
diff --git a/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/api/SolutionTrajectory.java b/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/api/SolutionTrajectory.java index d1a41065..500dd7d2 100644 --- a/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/api/SolutionTrajectory.java +++ b/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/api/SolutionTrajectory.java | |||
@@ -206,7 +206,14 @@ public class SolutionTrajectory { | |||
206 | } | 206 | } |
207 | }; | 207 | }; |
208 | long start = System.nanoTime(); | 208 | long start = System.nanoTime(); |
209 | editingDomain.getCommandStack().execute(cc); | 209 | try { |
210 | ((AdvancedViatraQueryEngine) engine).delayUpdatePropagation(() -> { | ||
211 | editingDomain.getCommandStack().execute(cc); | ||
212 | return null; | ||
213 | }); | ||
214 | } catch (InvocationTargetException e) { | ||
215 | throw new RuntimeException(e); | ||
216 | } | ||
210 | listener.forwardWorked(System.nanoTime() - start); | 217 | listener.forwardWorked(System.nanoTime() - start); |
211 | } | 218 | } |
212 | 219 | ||
diff --git a/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/base/DesignSpaceManager.java b/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/base/DesignSpaceManager.java index 4c6b4097..7e7a6e51 100644 --- a/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/base/DesignSpaceManager.java +++ b/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/base/DesignSpaceManager.java | |||
@@ -151,7 +151,14 @@ public class DesignSpaceManager implements IBacktrackListener { | |||
151 | Object previousState = trajectory.getCurrentStateId(); | 151 | Object previousState = trajectory.getCurrentStateId(); |
152 | 152 | ||
153 | long start = System.nanoTime(); | 153 | long start = System.nanoTime(); |
154 | domain.getCommandStack().execute(rc); | 154 | try { |
155 | engine.delayUpdatePropagation(() -> { | ||
156 | domain.getCommandStack().execute(rc); | ||
157 | return null; | ||
158 | }); | ||
159 | } catch (InvocationTargetException e) { | ||
160 | throw new RuntimeException(e); | ||
161 | } | ||
155 | forwardTime += System.nanoTime() - start; | 162 | forwardTime += System.nanoTime() - start; |
156 | 163 | ||
157 | Object newStateId = stateCoder.createStateCode(); | 164 | Object newStateId = stateCoder.createStateCode(); |
@@ -270,7 +277,14 @@ public class DesignSpaceManager implements IBacktrackListener { | |||
270 | }; | 277 | }; |
271 | 278 | ||
272 | long start = System.nanoTime(); | 279 | long start = System.nanoTime(); |
273 | domain.getCommandStack().execute(rc); | 280 | try { |
281 | engine.delayUpdatePropagation(() -> { | ||
282 | domain.getCommandStack().execute(rc); | ||
283 | return null; | ||
284 | }); | ||
285 | } catch (InvocationTargetException e) { | ||
286 | throw new RuntimeException(e); | ||
287 | } | ||
274 | forwardTime += System.nanoTime() - start; | 288 | forwardTime += System.nanoTime() - start; |
275 | 289 | ||
276 | Object newStateId = null; | 290 | Object newStateId = null; |