Quantcast

Running Repast headless?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Running Repast headless?

Van Parunak
I am building an application in which a swarm of agents runs continuously, as an optimization server that interacts with a separate front-end and databases through asynchronous messaging. For debugging and demo purposes, I'd want to show a graphical display in an appropriate perspective, as well perhaps as performance charts over time, but for production use I'd like to avoid the computational cost of updating the display.

I can think of two ways to do this, but neither is entirely satisfactory.

One is to delete any Displays and Charts from the scenario. I could still run the swarm from the RepastMain user interface to start and stop it. But then I'd have to maintain two versions of the code, which is awkward.

The other is to run the project as a batch job with a single run. But this way, I lose the user interface entirely, and would have to use another process to send it a message to terminate it.

Is there some programmatic way that I can tell a Repast project whether or not to produce graphical output based on a Boolean parameter that I give it?
--
H. Van Dyke Parunak, Ph.D.
President, ABC Research, LLC

Superior solutions through Agent-Based and Complex systems
email: van.parunak@...
cell: 734 395 3253
www.ABCResearch.org

------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Repast headless?

srcnick
Van,

Probably the easiest way to do this is to create two scenarios in the project. The first of these can include the display, charts etc. The second would omit anything you don’t want. You’d still have the runtime GUI but it wouldn’t update at all except for the tick count which is neglible. 

To create the second scenario, just copy the scenario folder for the first and paste it at the same level into the project. You’ll to create a launch configuration for that new scenario as well. In eclipse, run -> run configurations, click on the launcher for your model and then the duplicate button (the double papers next to the red X at the top of the launcher list). That will duplicate the launcher. In the duplicated launcher, change the program arguments in the arguments tab to point to the new scenario. You can then launch this scenario and add / delete elements of it. The source code will be the same for each scenario, you are only changing the run time GUI parts.

Nick


On Aug 26, 2016, at 12:02 PM, Van Parunak <[hidden email]> wrote:

I am building an application in which a swarm of agents runs continuously, as an optimization server that interacts with a separate front-end and databases through asynchronous messaging. For debugging and demo purposes, I'd want to show a graphical display in an appropriate perspective, as well perhaps as performance charts over time, but for production use I'd like to avoid the computational cost of updating the display.

I can think of two ways to do this, but neither is entirely satisfactory.

One is to delete any Displays and Charts from the scenario. I could still run the swarm from the RepastMain user interface to start and stop it. But then I'd have to maintain two versions of the code, which is awkward.

The other is to run the project as a batch job with a single run. But this way, I lose the user interface entirely, and would have to use another process to send it a message to terminate it.

Is there some programmatic way that I can tell a Repast project whether or not to produce graphical output based on a Boolean parameter that I give it?
--
H. Van Dyke Parunak, Ph.D.
President, ABC Research, LLC
<LogoColorArtNouveau.png>
Superior solutions through Agent-Based and Complex systems
email: <a href="x-msg://15/van.parunak@gmail.com" class="">van.parunak@...
cell: 734 395 3253
www.ABCResearch.org
------------------------------------------------------------------------------
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Repast headless?

Van Parunak
Nick This is exactly what I need. Thanks!
BTW, since my model will run indefinitely, will anything bad happen when tick count > MaxInt? Anything else that might require periodic restarts that I should know about?

On August 29, 2016 10:43:37 AM EDT, Nick Collier <[hidden email]> wrote:
Van,

Probably the easiest way to do this is to create two scenarios in the project. The first of these can include the display, charts etc. The second would omit anything you don’t want. You’d still have the runtime GUI but it wouldn’t update at all except for the tick count which is neglible. 

To create the second scenario, just copy the scenario folder for the first and paste it at the same level into the project. You’ll to create a launch configuration for that new scenario as well. In eclipse, run -> run configurations, click on the launcher for your model and then the duplicate button (the double papers next to the red X at the top of the launcher list). That will duplicate the launcher. In the duplicated launcher, change the program arguments in the arguments tab to point to the new scenario. You can then launch this scenario and add / delete elements of it. The source code will be the same for each scenario, you are only changing the run time GUI parts.

Nick


On Aug 26, 2016, at 12:02 PM, Van Parunak <[hidden email]> wrote:

I am building an application in which a swarm of agents runs continuously, as an optimization server that interacts with a separate front-end and databases through asynchronous messaging. For debugging and demo purposes, I'd want to show a graphical display in an appropriate perspective, as well perhaps as performance charts over time, but for production use I'd like to avoid the computational cost of updating the display.

I can think of two ways to do this, but neither is entirely satisfactory.

One is to delete any Displays and Charts from the scenario. I could still run the swarm from the RepastMain user interface to start and stop it. But then I'd have to maintain two versions of the code, which is awkward.

The other is to run the project as a batch job with a single run. But this way, I lose the user interface entirely, and would have to use another process to send it a message to terminate it.

Is there some programmatic way that I can tell a Repast project whether or not to produce graphical output based on a Boolean parameter that I give it?
--
H. Van Dyke Parunak, Ph.D.
President, ABC Research, LLC
<LogoColorArtNouveau.png>
Superior solutions through Agent-Based and Complex systems
email: <a href="x-msg://15/van.parunak@gmail.com" class="">van.parunak@...
cell: 734 395 3253
www.ABCResearch.org
------------------------------------------------------------------------------
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Repast headless?

srcnick
That’s a good question. It might roll over or more llikely it may throw an exception — its actually a double so it will take longer. Let us know what happens.

Nick

On Aug 29, 2016, at 11:38 AM, Van Parunak <[hidden email]> wrote:

Nick This is exactly what I need. Thanks!
BTW, since my model will run indefinitely, will anything bad happen when tick count > MaxInt? Anything else that might require periodic restarts that I should know about?

On August 29, 2016 10:43:37 AM EDT, Nick Collier <[hidden email]> wrote:
Van,

Probably the easiest way to do this is to create two scenarios in the project. The first of these can include the display, charts etc. The second would omit anything you don’t want. You’d still have the runtime GUI but it wouldn’t update at all except for the tick count which is neglible. 

To create the second scenario, just copy the scenario folder for the first and paste it at the same level into the project. You’ll to create a launch configuration for that new scenario as well. In eclipse, run -> run configurations, click on the launcher for your model and then the duplicate button (the double papers next to the red X at the top of the launcher list). That will duplicate the launcher. In the duplicated launcher, change the program arguments in the arguments tab to point to the new scenario. You can then launch this scenario and add / delete elements of it. The source code will be the same for each scenario, you are only changing the run time GUI parts.

Nick


On Aug 26, 2016, at 12:02 PM, Van Parunak <[hidden email]> wrote:

I am building an application in which a swarm of agents runs continuously, as an optimization server that interacts with a separate front-end and databases through asynchronous messaging. For debugging and demo purposes, I'd want to show a graphical display in an appropriate perspective, as well perhaps as performance charts over time, but for production use I'd like to avoid the computational cost of updating the display.

I can think of two ways to do this, but neither is entirely satisfactory.

One is to delete any Displays and Charts from the scenario. I could still run the swarm from the RepastMain user interface to start and stop it. But then I'd have to maintain two versions of the code, which is awkward.

The other is to run the project as a batch job with a single run. But this way, I lose the user interface entirely, and would have to use another process to send it a message to terminate it.

Is there some programmatic way that I can tell a Repast project whether or not to produce graphical output based on a Boolean parameter that I give it?
--
H. Van Dyke Parunak, Ph.D.
President, ABC Research, LLC
<LogoColorArtNouveau.png>
Superior solutions through Agent-Based and Complex systems
email: <a href="x-msg://15/van.parunak@gmail.com" class="">van.parunak@...
cell: 734 395 3253
www.ABCResearch.org
------------------------------------------------------------------------------
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.


------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Repast headless?

Van Parunak
Can I assign to it? I could just reset it periodically.

On August 30, 2016 9:06:04 AM EDT, Nick Collier <[hidden email]> wrote:
That’s a good question. It might roll over or more llikely it may throw an exception — its actually a double so it will take longer. Let us know what happens.

Nick

On Aug 29, 2016, at 11:38 AM, Van Parunak <[hidden email]> wrote:

Nick This is exactly what I need. Thanks!
BTW, since my model will run indefinitely, will anything bad happen when tick count > MaxInt? Anything else that might require periodic restarts that I should know about?

On August 29, 2016 10:43:37 AM EDT, Nick Collier <[hidden email]> wrote:
Van,

Probably the easiest way to do this is to create two scenarios in the project. The first of these can include the display, charts etc. The second would omit anything you don’t want. You’d still have the runtime GUI but it wouldn’t update at all except for the tick count which is neglible. 

To create the second scenario, just copy the scenario folder for the first and paste it at the same level into the project. You’ll to create a launch configuration for that new scenario as well. In eclipse, run -> run configurations, click on the launcher for your model and then the duplicate button (the double papers next to the red X at the top of the launcher list). That will duplicate the launcher. In the duplicated launcher, change the program arguments in the arguments tab to point to the new scenario. You can then launch this scenario and add / delete elements of it. The source code will be the same for each scenario, you are only changing the run time GUI parts.

Nick


On Aug 26, 2016, at 12:02 PM, Van Parunak <[hidden email]> wrote:

I am building an application in which a swarm of agents runs continuously, as an optimization server that interacts with a separate front-end and databases through asynchronous messaging. For debugging and demo purposes, I'd want to show a graphical display in an appropriate perspective, as well perhaps as performance charts over time, but for production use I'd like to avoid the computational cost of updating the display.

I can think of two ways to do this, but neither is entirely satisfactory.

One is to delete any Displays and Charts from the scenario. I could still run the swarm from the RepastMain user interface to start and stop it. But then I'd have to maintain two versions of the code, which is awkward.

The other is to run the project as a batch job with a single run. But this way, I lose the user interface entirely, and would have to use another process to send it a message to terminate it.

Is there some programmatic way that I can tell a Repast project whether or not to produce graphical output based on a Boolean parameter that I give it?
--
H. Van Dyke Parunak, Ph.D.
President, ABC Research, LLC
<LogoColorArtNouveau.png>
Superior solutions through Agent-Based and Complex systems
email: <a href="x-msg://15/van.parunak@gmail.com" class="">van.parunak@...
cell: 734 395 3253
www.ABCResearch.org
------------------------------------------------------------------------------
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Running Repast headless?

srcnick
You can’t really reset it. I can think of a workaround, but it would mean diverging the code for the two different scenarios. I

If your schedule is simple, that is, your model iterates by calling a single method or methods each time step, you could could call that method or methods in a loop within a single timestep. The tick count would never increase so you wouldn’t run into any problems with that. The code would have to diverge because without the schedule ever iteratiing the display update etc. would never get called. You could add a parameter that identifies the scenario and run different code based on that though. 

At any rate, I can say more about this, if it makes sense to you. I suppose though I would just run it as normal first and see what happens if you overflow the tick count.

Nick

On Aug 30, 2016, at 12:29 PM, Van Parunak <[hidden email]> wrote:

Can I assign to it? I could just reset it periodically.

On August 30, 2016 9:06:04 AM EDT, Nick Collier <[hidden email]> wrote:
That’s a good question. It might roll over or more llikely it may throw an exception — its actually a double so it will take longer. Let us know what happens.

Nick

On Aug 29, 2016, at 11:38 AM, Van Parunak <[hidden email]> wrote:

Nick This is exactly what I need. Thanks!
BTW, since my model will run indefinitely, will anything bad happen when tick count > MaxInt? Anything else that might require periodic restarts that I should know about?

On August 29, 2016 10:43:37 AM EDT, Nick Collier <[hidden email]> wrote:
Van,

Probably the easiest way to do this is to create two scenarios in the project. The first of these can include the display, charts etc. The second would omit anything you don’t want. You’d still have the runtime GUI but it wouldn’t update at all except for the tick count which is neglible. 

To create the second scenario, just copy the scenario folder for the first and paste it at the same level into the project. You’ll to create a launch configuration for that new scenario as well. In eclipse, run -> run configurations, click on the launcher for your model and then the duplicate button (the double papers next to the red X at the top of the launcher list). That will duplicate the launcher. In the duplicated launcher, change the program arguments in the arguments tab to point to the new scenario. You can then launch this scenario and add / delete elements of it. The source code will be the same for each scenario, you are only changing the run time GUI parts.

Nick


On Aug 26, 2016, at 12:02 PM, Van Parunak <[hidden email]> wrote:

I am building an application in which a swarm of agents runs continuously, as an optimization server that interacts with a separate front-end and databases through asynchronous messaging. For debugging and demo purposes, I'd want to show a graphical display in an appropriate perspective, as well perhaps as performance charts over time, but for production use I'd like to avoid the computational cost of updating the display.

I can think of two ways to do this, but neither is entirely satisfactory.

One is to delete any Displays and Charts from the scenario. I could still run the swarm from the RepastMain user interface to start and stop it. But then I'd have to maintain two versions of the code, which is awkward.

The other is to run the project as a batch job with a single run. But this way, I lose the user interface entirely, and would have to use another process to send it a message to terminate it.

Is there some programmatic way that I can tell a Repast project whether or not to produce graphical output based on a Boolean parameter that I give it?
--
H. Van Dyke Parunak, Ph.D.
President, ABC Research, LLC
<LogoColorArtNouveau.png>
Superior solutions through Agent-Based and Complex systems
email: <a href="x-msg://15/van.parunak@gmail.com" class="">van.parunak@...
cell: 734 395 3253
www.ABCResearch.org
------------------------------------------------------------------------------
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.


------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Loading...