QUERY Hybrid Discrete/Continuous Examples

This forum contains all archives from the SD Mailing list (go to http://www.systemdynamics.org/forum/ for more information). This is here as a read-only resource, please post any SD related questions to the SD Discussion forum.
Locked
Francisco Perez
Junior Member
Posts: 6
Joined: Fri Mar 29, 2002 3:39 am

QUERY Hybrid Discrete/Continuous Examples

Post by Francisco Perez »

Posted by Francisco Perez <francisco77pp@yahoo.com> Hi people, currently I am doing some research about what's going on with hybrid approach in simulation projects. I am particularly interested in any reference you can give (including yourself) about modeling with Anylogic using SD and Discrete/Agent Based approaches. Any comments regarding how you approach hybridation of paradigms, pros/cons, and any other technical/logistical comment will be welcome.

Best regards
Francisco
Posted by Francisco Perez <francisco77pp@yahoo.com> posting date Tue, 7 Nov 2006 13:42:30 -0800 (PST) _______________________________________________
""Timothy Quinn""
Newbie
Posts: 1
Joined: Fri Mar 29, 2002 3:39 am

QUERY Hybrid Discrete/Continuous Examples

Post by ""Timothy Quinn"" »

Posted by ""Timothy Quinn"" <tdquinn@MIT.EDU> Dear Francisco,

I am also currently researching hybrid simulation. I am using AnyLogic, because it is seemingly the only off-the-shelf package that can accommodate such hybrid modeling.

I believe that hybrid modeling represents a promising avenue, but with an important caveat: the increased flexibility places a methodological burden on the modeler even greater than what is required for ""standard"" SD modeling. No offense intended toward the XJ Technologies folks, but I think AnyLogic's ability to assist in the *process* of modeling lags far behind its functional capabilities.

I define discrete-event simulation (DES) according to Geoffrey Gordon's
(1962) original intentions with GPSS. (I also observe how remarkably little DES simulation has changed conceptually from Gordon's original work). The focus is on entities (people, widgets, orders, etc.) flowing through a process flowchart or network comprising mostly servers and queues. Each step in the process is represented by a ""block"", which encapsulates the mathematical definition of that step's behavior. The term ""discrete-event""
refers to the points in time at which entities are passed from one block to another. I think the defining feature of DES is that the entities flowing through the model's blocks are passive: the timing, routing, and other behaviors of entity flow are determined by parameterization of the blocks, not of the entities.

Gordon G. A general purpose systems simulator. IBM Systems Journal.
September 1962;1:18-32. Available at
http://www.research.ibm.com/journal/sj/.

When I built models with GUI software packages like Extend (back in the days of version 4!), I was always frustrated by the lack of easy access to all the logic and parameters of the model. These details were ""hidden"" inside the model blocks. This problem persists with object-oriented software like AnyLogic, although AnyLogic at least provides a function that automatically creates (limited) model documentation in HTML.

Bernard Zeigler, at the University of Arizona, has formalized the mathematics of DES, which he calls DEVS. I'm not sure how much this formalism is applied outside of computer science circles (or even within them.). A short overview is

Zeigler BP. DEVS Today: Recent Advances in Discrete Event-Based Information Technology. Paper presented at: 11th IEEE/ACM International Symposium on Modeling, Analysis and Simulation of Computer Telecommunications Systems (MASCOTS); 12-15 October, 2003. Available at:
http://ieeexplore.ieee.org/iel5/8783/27 ... 27814?=STD&
arnumber=1240652&arnumber=1240652&arSt=+148&ared=+161&arAuthor=Zeigler%2C+B.
P.

but his authoritative reference is now the following:

Zeigler BP, Praehofer H, Kim TG. Theory of Modeling and Simulation:
Integrating Discrete Event and Continuous Complex Dynamic Systems. 2nd ed.
San Diego, CA: Academic Press; 2000.

In contrast to DES, ""traditional"" agent-based modeling (ABM) situates the logic of entity behavior within the entities themselves. ABM descends from the tradition of cellular automata: John Conway's Game of Life, Wolfram, Holland, etc. In this modeling approach, the environment is passive, but may provide the entities with data (e.g., spatial distribution of the population of entities, other environmental conditions).

Statecharts (see AnyLogic documentation) do a better job of organizing the logic of ABM entities than the ""mess"" of formulating and parameterizing a DES model. However, the transparency of ABM model structure for model validation (I use the term in the same sense as John Sterman 2000) still does not equal that of standard SD practice.

Given my definitions of DES and ABM above, it is obvious that there is grey area between the two approaches. An object-oriented environment like AnyLogic is nonpartisan: it does not care whether the logic of the model is placed within the entities or in the blocks (objects) constituting the entities' environment, or in both places.

Here is where AnyLogic's flexibility places increased demands on the modeler. Where should the logic for a given action be defined: in a block or within an entity? A tempting answer might be that is doesn't matter, as long as the desired aggregate model behavior is produced. An open empirical question is whether this answer is true or not. However, I argue that effort should be made to make these choices based upon the characteristics of the entities being modeled. I will use the Delay ActiveObject from the Enterprise Library (version 5.5) as an example.

The Delay object has a statechart that ""continuously"" monitors for entity arrivals at the input Port. An entity arrival triggers the entityIn() method of Delay, one step of which is to create a Dynamic Timer object to determine the entity's duration in the Delay. The Dynamic Timer is then ""attached"" to the entity. So far, these choices are okay. However, there is no Delay statechart corresponding to required entity departures from the output Port. Instead, the required processing is handled by the Dynamic Timer's expiration method. While this formulation accomplished the needed behavior, a more realistic formulation would have the Dynamic Timer send a signal event to the Delay block for processing.

Perhaps my criticism is just pedantic quibbling. (Perhaps the XJ Technologies folks have a retort based upon computing efficiency
considerations?) But given the difficulty of building an SD model that is robust to extreme conditions, I believe that these details should at least be examined rigorously.

Finally, there is the question of combining DES/ABM model structure with continuous-time model structure. It's useful to review Herbert Simon's concept of a ""production"". Each production is a process that consists of two parts: (1) a set of tests or conditions, and (2) a set of actions to be taken whenever the set of conditions are all true. The definition and application of Simon's production systems are discussed in

Newell A, Simon HA. Human Problem Solving. Englewood Cliffs, NJ:
Prentice-Hall; 1972.

but a short explanation is to be found in chapter 4 of

Simon HA. The Sciences of the Artificial. 3rd ed. Cambridge, MA: MIT Press; 1996.

The logic of ""productions"" underlies the interface between continuous-time and discrete-event model formulations. A transparent interface between the two is embodied by the use of statecharts (either in entities or in blocks).
In AnyLogic, different sets of continuous-time equations can be associated with different states of a statechart. Therefore, a discrete event triggering a state transition deactivates one set of model equations and activates a different set. In this way, the discrete-event-driven model components interact with the continuous-time components.

A state transition (action) can be triggered by a logical expression
(condition) evaluating to ""true"". The logical expression can be of the form ""if an event of type Z occurs"" (discrete condition, discrete action), but it can also be of the form ""if variable X > 5"" (continuous condition, discrete action).

Continuous-time formulations can also trigger discrete events without the explicit use of statecharts, such as when Java if-then expressions are used, either within AnyLogic's ""algorithmic functions"" or within object class definitions. Even without statecharts, however, these cases still conform to Simon's definition of ""productions"".

For the sake of stoking the fires of debate, I'll point out a few more relevant issues. First, computer programming must respect the rules of variable and object types - including the object-oriented complications of type-casting upward or downward - but there isn't yet the added constraint of dimensional consistency (or checking). A boolean value cannot be used where an integer is called for, but AnyLogic does not complain if counts of people are confounded with counts of widgets.

Second, much of the logic underlying AnyLogic's ""base"" object classes remains less than transparent, raising problems for clear theory-building using hybrid simulation. In particular, how the Port class handles sending and receiving entities is complicated and unintuitive.

Third, hybrid (and arguably DES and ABM) simulation doesn't yet have standard model-analysis tools analogous to SD's causal tracing, loop knockout analysis, or eigenvalue analysis, although goodness-of-fit statistics, parameter sensitivity analysis, optimization, and behavior-over-time graphs are all used in all three approaches. From AnyLogic's example models, I get the impression that a lot of emphasis is placed on flashy animation, but without a rigorous approach to understanding what is really going on (how structure leads to behavior).

Just my $0.02.

Regards,
Tim Quinn
~~~~~~~~~
PhD Candidate
System Dynamics Group
MIT Sloan School of Management
Posted by ""Timothy Quinn"" <tdquinn@MIT.EDU> posting date Wed, 8 Nov 2006 14:23:09 -0600 _______________________________________________
""Geoff McDonnell""
Junior Member
Posts: 3
Joined: Fri Mar 29, 2002 3:39 am

QUERY Hybrid Discrete/Continuous Examples

Post by ""Geoff McDonnell"" »

Posted by ""Geoff McDonnell"" <gmcdonne@bigpond.net.au> Hi Francisco, see http://www.hpsig.com/index.php?title=Em ... m_Dynamics
and http://www.hpsig.com/index.php?title=Simulation_Methods

There are examples at www.xjtek.com www.anysims.com and www.healthsims.com.au

In several fields (esp -omics and systems biology) this approach is quite similar to multiscale modeling and the latest IEEE computer has an article on this.
http://doi.ieeecomputersociety.org/10.1109/MC.2006.392

IMHO the biggest difficulty is shifting between different methods of conceptualisation and abstraction.

It may be that these hybrid models are better developed with a team of AB and SD modelers.....DES as a process/event abstraction is usually no problem

We usually start with an SD model and then replace a ""sector"" with an AB or DES ""object""


regards
geoff
Dr Geoff McDonnell
Director Adaptive Care Systems
ABN 65 095 766 822
Posted by ""Geoff McDonnell"" <gmcdonne@bigpond.net.au>
posting date Thu, 9 Nov 2006 03:06:52 +1100
_______________________________________________
Jean-Jacques Laublé
Junior Member
Posts: 12
Joined: Fri Mar 29, 2002 3:39 am

QUERY Hybrid Discrete/Continuous Examples

Post by Jean-Jacques Laublé »

Posted by Jean-Jacques Laublé <jean-jacques.lauble@wanadoo.fr> Hi every body.



About Anylogic, one thing is not clear to me.

With usual DES packages you do not have any feed backs.

You can have levels that are cumulated all over the time of the simulation but with

no regular values during the simulation.

In extend you have stocks but no feed backs even with it is working continuously.

I am talking about the version that is already 4 years old that I have tested.

The explanation of the lack of feed back is simple.

To have feed backs it is necessary to have a value that can influence the same value some time later. With DES where there are no fixed time steps, and no associated values, it cannot be done. SD deals with aggregate that change with time, and DES deals with events and when they happen.

So it would be interesting to know how, one can have at the same time a fixed slicing of the time, events occurring for instance on a relatively short time scale, generating queues for instance, stocks being calculated every time step, generating feed backs, and how all these values influence one another.

The people of Anylogic should give a preferably very simple example that illustrates how it works.

I find already difficult to use efficiently the SD paradigm, and do not need a still more complicated method!

Regards.

Jean-Jacques Laublé.
Posted by Jean-Jacques Laublé <jean-jacques.lauble@wanadoo.fr> posting date Thu, 9 Nov 2006 18:59:52 +0100 _______________________________________________
Francisco Perez
Junior Member
Posts: 6
Joined: Fri Mar 29, 2002 3:39 am

QUERY Hybrid Discrete/Continuous Examples

Post by Francisco Perez »

Posted by Francisco Perez <francisco77pp@yahoo.com> Hi Jean Jacques,

I think the feedback concept is not a simulation but a systemic concept.
Whatever paradigm you use (DES, ABS, SD, etc) you can always incorporate feedback. For example, consider a DES model that employs resources to achieve certain tasks/processes, by only incorporating decision rules regarding how to manage the stocks and thence how the resource will be deployed depending on the stock level, you will notice, if you look at the system structure, that there are feedback loops.

Usually when modelers choose a DES approach they often model the system as open loop or nealy open loop system, making the system behave as if there where no superior agent controlling the whole production/service/ process. Closing the loops should be an elemental taks every modeler should take care of, even if the scope doesnt involve doing it, there must be awareness of system behaviour, particularly if there is known to be that the system if under human decision making processes/acitvities.

Well Jean, I've always appreciated your comments due to your sincere and practical point of view. I hope my comments open an interesting debate without distortioning the main Thread: Hybrid Approaches.


Regards
Francisco
Posted by Francisco Perez <francisco77pp@yahoo.com> posting date Fri, 10 Nov 2006 07:36:41 -0800 (PST) _______________________________________________
Bipin Chadha
Newbie
Posts: 1
Joined: Fri Mar 29, 2002 3:39 am

QUERY Hybrid Discrete/Continuous Examples

Post by Bipin Chadha »

Posted by Bipin Chadha <bchadha@coensys.com> We are developing hybrid simulations for some DoD programs and what we are finding is that there is limited understanding at the process level as well as at the problem definition level in addressing ""system""
problems. Folks are building niche models using different paradigms that limits their ability to address broader problems.

I also think that lack of tools (in past) also contributes to folks not investing much time in developing processes for developing hybrid models.
>From that perspective having tools like Anylogic helps folks (like Tim)
try out new ideas and start developing innovative processes for building hybrid models. So I completely agree that processes are lagging behind, but it is no surprise. Now that we have some tools, the real work of building rigorous processes and theory can begin and it is very encouraging to see that folks like Tim are beginning to do that.


My perspective is more of a practitioner trying to use the most appropriate tools to build system level models that would otherwise be much harder to build. Understanding of what modeling paradigm works best for what aspects of a system is still evolving. Here are some thoughts based on my experiences:

1. Appropriate modeling requires that the modeler understands and is
proficient in all techniques. If all you have is a hammer.......
2. Use the paradigm that is the most natural fit to the aspect/characteristic
being modeled ( I would use SD for modeling diffusion of scents, while using
agents to model people looking for food in the food court, the food
preparation assembly line might be best modeled using DES, use the state
charts to trigger process exceptions). There are some simple Anylogic
examples with hints of this.
3. You could start with a SD and/or a DES model and selectively turn some
entities into agents based on the need for differentiation or autonomy/
agency in behavior. Every step you take, you can evaluate to see whether
you see something that is new and interesting in the behavior - if not,
maybe you need to look at some other aspect. The Anylogic tutorial for
SD kind of works that way.
4. If some aspect of the ABM model is getting to unwieldy, one might replace
that aspect with SD ( like anything it is tradeoff between fidelity and
level of effort/performance - for any model there will be diminishing returns).
5. There is no silver bullet for simulation validation.

Thanks,
Bipin

___________________________________________________________

Bipin Chadha

Coensys, Inc.
Posted by Bipin Chadha <bchadha@coensys.com> posting date Sat, 11 Nov 2006 11:16:37 -0500 _______________________________________________
Jean-Jacques Laublé
Junior Member
Posts: 12
Joined: Fri Mar 29, 2002 3:39 am

QUERY Hybrid Discrete/Continuous Examples

Post by Jean-Jacques Laublé »

Posted by Jean-Jacques Laublé <jean-jacques.lauble@wanadoo.fr> Hi Francisco

I believe like you that feedbacks are systemic (the notion of system is not easy to define) but when you consult the web sites of different DES packages, you will generally not see nay reference to any feed back. (Example SIMUL8, Extend etc.)

In Extend it seems that with newer versions, feed backs are considered when the package is working continuously, but it is not working the same way then current DS packages do.

I think that there might be two reasons for that.
The first is that DES considers a system as the result of multiple events and that the study of these individual events is enough to explain how the whole system works so DES is not so much systemic. DES is then not interested in feed back loops that take a more holistic approach.

A second reason may be practical: It must no be easy to make feed back loops work, when only a part of the system changes when an event occurs. Will the feed back loops work every time a new event is occurring? I think it must not be easy to implement.
This is why I was interested how practically anylogic is managing this difficulty.
One other question is the utility of mixing paradigms in the same model.
What is the added value, considering the added complexity. What about using SD and then DES or AB, successively, if one has different kind of problems?

I think that the problem for SD is not getting more powerful but identifying better when it can be used with profit, and helping concretely users to build useful models.
Regards.
Jean-Jacques Laublé
Posted by Jean-Jacques Laublé <jean-jacques.lauble@wanadoo.fr> posting date Sat, 11 Nov 2006 15:37:19 +0100 _______________________________________________
""Ortiz, Adriana Maria""
Newbie
Posts: 1
Joined: Fri Mar 29, 2002 3:39 am

QUERY Hybrid Discrete/Continuous Examples

Post by ""Ortiz, Adriana Maria"" »

Posted by ""Ortiz, Adriana Maria"" <amortiz@tecnun.es> Hi Francisco,

I have been studying the differences between ABM, SD, Econometrics and recently DE. In my research group we have been using Anylogic software as an Agent Based Approach. Although I am more interested in analysing the differences between the paradigms and how they influence the creation of models, I can see the potential that Anylogic software has to offer for hybrid modelling.

I would like to suggest to you some references that I think can help:

- Schieritz, N. & Milling, PM. (2002). Modeling the Forest or Modeling the
Trees: A Comparison of System Dynamics and Agent-Based Simulation. IEEE
Computer Science.

- Schieritz, N. & Größler, A. (2003). Emergent Structures in Supply Chains -
A Study Integrating Agent-Based and System Dynamics Modeling. Proceedings
of the 36th Hawaiian International Conference on System Science, Wailea.

- Ortiz, A, Sarriegi, J., and Santos, J. Applying Modelling Paradigms to analyse
Organisational Problems. Proceedings of the 24th International Conference of
the System Dynamics Society. Nijmegen, The Netherlands.

When I have permission (hopefully next week) I will make these papers amongst others available on the website of the Multi Method Modelling Discussion Group (m_kubed), in which I take part in as a moderator. The website address is:

http://uk.groups.yahoo.com/group/m_kubed/

We are now in the process of creating a collection of papers and documents dealing with multi method issues. So please, if you have any other paper or additional material to share with others in the group, I would be very grateful if you can email them to me.

Finally, I would like to ask you, can you explain what you understand by hybrid simulation? Do you mean a combination of discrete and continuous time handling or a combination of different paradigms?

Regards,


Adriana Ortiz
PhD Candidate
Industrial Management Department
TECNUN - University of Navarra
Paseo Manuel de Lardizabal, 13
20018 San Sebastián
Spain
Posted by ""Ortiz, Adriana Maria"" <amortiz@tecnun.es> posting date Fri, 17 Nov 2006 19:48:10 +0100 _______________________________________________
Locked