Re: [julia-users] ANN: SimJulia 0.3.4
Thanks for the detailed response Ben. I absolutely see the value in event-style programming. I have my own version of this... it may not be as feature-full, but it's pretty fast. I use it mainly to process various financial events (exchange messages, order book updates, etc) but it's fairly flexible. I have a few random things in a repo which I just made public (but it's certainly not something that belongs in metadata)... if you're curious at all, check out the pubsub.jl and scheduler.jl files at https://github.com/tbreloff/CTechCommon.jl. When I have some time I'll try to see if it makes sense to start using SimJulia instead or in addition to my own scheduler. On Tue, Aug 18, 2015 at 2:36 PM, Ben Lauwens wrote: > Tom > > The event scheduling in SimJulia is based on the standard PriorityQueue* > implementation of Julia and the overhead of SimJulia is really limited. If > you throw away the process oriented way of defining a simulation model, you > can do theoretically better, i.e. pure event simulation. This is certainly > true for small models but for bigger ones you (I for sure) will end up > developing a massive spaghetti code. > I have used the previous version of SimJulia in some large simulation > models and compared to SimPy or commercial simulation software (ARENA) the > speedup I measured was often more than two orders of magnitude. We are > right now porting two large projects (HR planning and medical battlefield > management) from ARENA to SimJulia. The benefits of Julia are enormous. No > more mixed code (SIMAN and Visual Basic) and being able to troubleshoot the > internals of the simulation are for me the most important advantages. > > * The standard PriorityQueue is based on a binary heap and in my PhD I > have shown that if you have no prior knowledge on the timing of the events, > no event calendar (tree, heap, sorting, ...) can do better in a real > implementation if you consider the extreme low overhead of its > implementation (Vector based, no pointers and limited number of > comparisons). I know that some other heap mechanisms (Binomial, Fibonacci, > ...) have better time complexities but I have never found one that > performed as well on real use cases as as binary heap. > > Most people are afraid of this process oriented programming. Programmers > prefer the idea of sequential execution and the main philosophy of > processes is asynchronous tasking. It takes my master students some weeks > to get used to it but once they passed this difficulty, they are ready to > tackle real world simulation problems. > > Often (almost always) we are doing Montecarlo simulations of 1000 or more > repetitions and use the SimJulia framework in the inner loop. We are also > working on simulation based optimization and the SimJulia framework is also > used in the inner loop. To estimate the loss of speed compared to a more > direct approach is very difficult to predict. One thing I am quite sure of > is the ease of development when using process based simulations. > > I hope that I somehow answered your question. Please feel free to contact > me if you need some assistance with your SimJulia coding. > > Ben > > On Tuesday, August 18, 2015 at 9:52:21 PM UTC+2, Tom Breloff wrote: >> >> Thanks for the effort Ben. I'm curious... do you have any performance >> comparisons of SimJulia vs other (simpler) code designs? How much speed >> would I be giving up if I was using events in a tight inner loop? >> >> On Tue, Aug 18, 2015 at 1:25 PM, Ben Lauwens wrote: >> >>> Hi >>> >>> SimJulia, a (combined continuous time / ) discrete event process >>> oriented simulation framework, has reached another milestone: >>> >>>- v0.3.4 synchronizes the API with SimPy v3 but using some specific >>>Julia semantics >>>- It is a complete rewrite allowing a more powerful and unified >>>discrete event approach >>>- 10 min tutorial is included to give users a taste of discrete >>>event simulation with (Sim)Julia >>>- A detailed topical guide is also written >>> >>> For the moment the continuous time part is not operational. A *quantized >>> state system* (QSS) solver is being developed for continuous system >>> simulation using the discrete event framework. Once this is done v0.4 >>> will be tagged. >>> New ideas or interesting examples are always welcome and can be >>> submitted as an issue or a pull request on GitHub. >>> Enjoy! >>> >>> Ben >>> >> >>
Re: [julia-users] ANN: SimJulia 0.3.4
Tom The event scheduling in SimJulia is based on the standard PriorityQueue* implementation of Julia and the overhead of SimJulia is really limited. If you throw away the process oriented way of defining a simulation model, you can do theoretically better, i.e. pure event simulation. This is certainly true for small models but for bigger ones you (I for sure) will end up developing a massive spaghetti code. I have used the previous version of SimJulia in some large simulation models and compared to SimPy or commercial simulation software (ARENA) the speedup I measured was often more than two orders of magnitude. We are right now porting two large projects (HR planning and medical battlefield management) from ARENA to SimJulia. The benefits of Julia are enormous. No more mixed code (SIMAN and Visual Basic) and being able to troubleshoot the internals of the simulation are for me the most important advantages. * The standard PriorityQueue is based on a binary heap and in my PhD I have shown that if you have no prior knowledge on the timing of the events, no event calendar (tree, heap, sorting, ...) can do better in a real implementation if you consider the extreme low overhead of its implementation (Vector based, no pointers and limited number of comparisons). I know that some other heap mechanisms (Binomial, Fibonacci, ...) have better time complexities but I have never found one that performed as well on real use cases as as binary heap. Most people are afraid of this process oriented programming. Programmers prefer the idea of sequential execution and the main philosophy of processes is asynchronous tasking. It takes my master students some weeks to get used to it but once they passed this difficulty, they are ready to tackle real world simulation problems. Often (almost always) we are doing Montecarlo simulations of 1000 or more repetitions and use the SimJulia framework in the inner loop. We are also working on simulation based optimization and the SimJulia framework is also used in the inner loop. To estimate the loss of speed compared to a more direct approach is very difficult to predict. One thing I am quite sure of is the ease of development when using process based simulations. I hope that I somehow answered your question. Please feel free to contact me if you need some assistance with your SimJulia coding. Ben On Tuesday, August 18, 2015 at 9:52:21 PM UTC+2, Tom Breloff wrote: > > Thanks for the effort Ben. I'm curious... do you have any performance > comparisons of SimJulia vs other (simpler) code designs? How much speed > would I be giving up if I was using events in a tight inner loop? > > On Tue, Aug 18, 2015 at 1:25 PM, Ben Lauwens > wrote: > >> Hi >> >> SimJulia, a (combined continuous time / ) discrete event process >> oriented simulation framework, has reached another milestone: >> >>- v0.3.4 synchronizes the API with SimPy v3 but using some specific >>Julia semantics >>- It is a complete rewrite allowing a more powerful and unified >>discrete event approach >>- 10 min tutorial is included to give users a taste of discrete event >>simulation with (Sim)Julia >>- A detailed topical guide is also written >> >> For the moment the continuous time part is not operational. A *quantized >> state system* (QSS) solver is being developed for continuous system >> simulation using the discrete event framework. Once this is done v0.4 >> will be tagged. >> New ideas or interesting examples are always welcome and can be submitted >> as an issue or a pull request on GitHub. >> Enjoy! >> >> Ben >> > >
Re: [julia-users] ANN: SimJulia 0.3.4
Thanks for the effort Ben. I'm curious... do you have any performance comparisons of SimJulia vs other (simpler) code designs? How much speed would I be giving up if I was using events in a tight inner loop? On Tue, Aug 18, 2015 at 1:25 PM, Ben Lauwens wrote: > Hi > > SimJulia, a (combined continuous time / ) discrete event process oriented > simulation framework, has reached another milestone: > >- v0.3.4 synchronizes the API with SimPy v3 but using some specific >Julia semantics >- It is a complete rewrite allowing a more powerful and unified >discrete event approach >- 10 min tutorial is included to give users a taste of discrete event >simulation with (Sim)Julia >- A detailed topical guide is also written > > For the moment the continuous time part is not operational. A *quantized > state system* (QSS) solver is being developed for continuous system > simulation using the discrete event framework. Once this is done v0.4 > will be tagged. > New ideas or interesting examples are always welcome and can be submitted > as an issue or a pull request on GitHub. > Enjoy! > > Ben >
[julia-users] ANN: SimJulia 0.3.4
Hi SimJulia, a (combined continuous time / ) discrete event process oriented simulation framework, has reached another milestone: - v0.3.4 synchronizes the API with SimPy v3 but using some specific Julia semantics - It is a complete rewrite allowing a more powerful and unified discrete event approach - 10 min tutorial is included to give users a taste of discrete event simulation with (Sim)Julia - A detailed topical guide is also written For the moment the continuous time part is not operational. A *quantized state system* (QSS) solver is being developed for continuous system simulation using the discrete event framework. Once this is done v0.4 will be tagged. New ideas or interesting examples are always welcome and can be submitted as an issue or a pull request on GitHub. Enjoy! Ben