Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to syncronize an ongoing simulation?
How to syncronize an ongoing simulation? [message #1405511] Thu, 07 August 2014 14:08 Go to next message
Marcin Trycz is currently offline Marcin TryczFriend
Messages: 12
Registered: August 2014
Junior Member
Hello, I'm a new user of Syrius, and have been exploring the various possibilites of the framework lately.

I like the framework really much, compared to standard GMF I've been able to set up a visual modeler in very little time.

---
My project is a bioinformatics model/simulator for describing gene interactions (qualitative).
The model itself is very simple really, we have a graph, where genes are nodes and interactions are edges, with interaction logic expressed as edge attributes. The current state of the nodes determines the next step through the interactions between the nodes.
The project is part of my final thesis defense (major) in CS, and will be distributed (open source) to biologists doing research on gene interactions. In addition to implementing our own model we want to set up a framework where others can plug-in their models, views and simulations. Sirius is making this part much easier for us.

We have already described the model with Ecore and created a Sirius view with sufficient detail. We have created several Tools for interacting with the diagram and hooked up a couple of External Java Actions for simple interactions.

What we are considering now is adding a simulator to the model. With an External Java Action we can compute a step of a simulation (ie. set the nodes' state based on the current states).

It should also be reasonably easy to compute a simulation path and write it to a file, and optionally visualize the results with an external library (haven't done this yet, but it'll be done in the next weeks).

---
What isn't obvious to us is how to run an ongoing simulation within the diagram/view. What we would like to do is to push a button on the interface and have a java action compute the next state, update the view, wait for 1000ms, repeat (until the simulation is cancelled). Right now all I'm only able to see the updates after the whole External Java Action is over.

I've tried doing some .update() or .refresh() methods on the diagram object, using ENotifications and such, but I'm blindly trying whatever comes to mind. I don't have sufficient understanding of the framework to make it happen.

So basically what I'm asking is: how can I refreh the view from within and ongoing external java action?
Or is there am other/better way of doing what I'm trying to do?
I can provide the sources if need be.

Thank you in advance,
Martin


I'm just a user.
Re: How to syncronize an ongoing simulation? [message #1405952 is a reply to message #1405511] Fri, 08 August 2014 15:36 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 701
Registered: July 2009
Senior Member
Le 07/08/2014 16:16, Marcin Trycz a écrit :
> Hello, I'm a new user of Syrius, and have been exploring the various
> possibilites of the framework lately.
>
> I like the framework really much, compared to standard GMF I've been
> able to set up a visual modeler in very little time.
>
> What isn't obvious to us is how to run an ongoing simulation within the
> diagram/view. What we would like to do is to push a button on the
> interface and have a java action compute the next state, update the
> view, wait for 1000ms, repeat (until the simulation is cancelled). Right
> now all I'm only able to see the updates after the whole External Java
> Action is over.

When you apply a tool on a Sirius representation, it is executed inside
an atomic transaction, and the UI is updated only at the end.

> So basically what I'm asking is: how can I refreh the view from within
> and ongoing external java action?

This is not possible (at least not in a way this is supported and reliable).

> Or is there am other/better way of doing what I'm trying to do?
> I can provide the sources if need be.

You probably need to drive the changes from outside of Sirius itself,
maybe with a separate Eclipse view or action. Off the top of my head
(untested):

1. Listen to the workspace selection so that you can obtain a reference
to a model element from inside the concerned session, and then to the
Session to drive itself.
2. At each step in your simulation, execution the step in a complete
transaction from the point of of of Sirius.

--
Pierre-Charles David - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Dynamic creation of tool
Next Topic:Style of selected item in tree editor
Goto Forum:
  


Current Time: Thu Mar 28 08:40:03 GMT 2024

Powered by FUDForum. Page generated in 0.05455 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top