<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/simmer-v3-5-0-released-on-cran/"></div></div><div><a data-url="https://www.r-bloggers.com/simmer-v3-5-0-released-on-cran/" data-counturl="https://www.r-bloggers.com/simmer-v3-5-0-released-on-cran/" data-count="horizontal" data-text="simmer v3.5.0 released on CRAN" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://fishyoperations.com/2016/10/27/simmer-v350-released-on-cran.html"> FishyOperations</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>We are proud to present <a target="_blank" rel="nofollow" href="http://r-simmer.org/"><strong>simmer 3.5.0</strong></a>, a new release on CRAN of the Discrete-Event Simulator for R with a bunch of exciting features:</p>
<ul>
<li><strong>Simpler logging</strong>. So far, if we wanted arrivals to print something into the console, we had, for instance, to make a custom function returning zero, with a <code>print()</code> inside, and to put it into a <code>timeout()</code> activity. Now, with <code>log_()</code> it’s easier and, in addition, you get the simulation time and the arrival name:</li>
</ul>
<pre><code>library(simmer)

sayer &lt;- create_trajectory() %>%
  log_(&quot;hello world!&quot;)

simmer() %>%
  add_generator(&quot;dummy&quot;, sayer, at(3, 6)) %>%
  run() %>% invisible
</code></pre>
<pre><code>## 3: dummy0: hello world!
## 6: dummy1: hello world!
</code></pre>
<ul>
<li><strong>New resource modifiers</strong>. <code>set_capacity()</code> and <code>set_queue_size()</code> existed before, but they were not very useful. Now, these methods become activities and you can use them in your trajectories. They have their associated <code>set_capacity_selected()</code> and <code>set_queue_size_selected()</code>, just like <code>seize()</code> and <code>release()</code>, for a joint use with the resource selector <code>select()</code>.</li>
<li><strong>New generator modifiers</strong>. Activities <code>activate()</code>, <code>deactivate()</code> allow us to start/stop generators from within trajectories. Activities <code>set_trajectory()</code>, <code>set_distribution()</code> allow us to change a generator’s assigned trajectory or distribution respectively.</li>
<li><strong>New interarrival communication activities, allowing asynchronous programming</strong>. <code>send()</code>, <code>trap()</code>, <code>untrap()</code> and <code>wait()</code> can be used to send signals, wait for signals, trap them and launch asynchronous handlers. Nothing better than an example to understand the possibilities of this mechanism:</li>
</ul>
<pre><code>library(simmer)

t_blocked &lt;- create_trajectory() %>%
  trap(&quot;you shall pass&quot;,
       handler = create_trajectory() %>%
         log_(&quot;ok, I'm packing...&quot;) %>%
         timeout(1)) %>%
  log_(&quot;waiting...&quot;) %>%
  wait() %>%
  log_(&quot;and I'm leaving!&quot;)

t_signaler &lt;- create_trajectory() %>%
  log_(&quot;you shall pass&quot;) %>%
  send(&quot;you shall pass&quot;)

simmer() %>%
  add_generator(&quot;blocked&quot;, t_blocked, at(0)) %>%
  add_generator(&quot;signaler&quot;, t_signaler, at(5)) %>%
  run() %>% invisible
</code></pre>
<pre><code>## 0: blocked0: waiting...
## 5: signaler0: you shall pass
## 5: blocked0: ok, I'm packing...
## 6: blocked0: and I'm leaving!
</code></pre>
<p>Other interesting new features from <a target="_blank" rel="nofollow" href="http://r-simmer.org/news/index.html">past releases</a> since our last post include <a target="_blank" rel="nofollow" href="http://r-simmer.org/articles/C-trajectories.html#seize-release"><em>post-seize</em> and <em>reject</em></a> optional trajectories when seizing resources, arrival <a target="_blank" rel="nofollow" href="http://r-simmer.org/articles/C-trajectories.html#clone-synchronize">cloning and synchronizing</a>, arrival <a target="_blank" rel="nofollow" href="http://r-simmer.org/articles/C-trajectories.html#batch-separate">batching and separating</a> or <a target="_blank" rel="nofollow" href="http://r-simmer.org/articles/C-trajectories.html#renege_in-renege_abort">reneging</a>.</p>
<p>Please, refer to the updated <a target="_blank" rel="nofollow" href="http://r-simmer.org/articles/C-trajectories.html"><em>Advanced Trajectory Usage</em></a> vignette for more information and examples. Also remember that you can participate in our <a target="_blank" rel="nofollow" href="https://groups.google.com/forum/#!forum/simmer-devel">simmer-devel mailing list</a> to get help, discuss methodologies… any feedback is always welcome.</p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="https://www.r-bloggers.com/simmer-v3-5-0-released-on-cran/"></div></div><div><a data-url="https://www.r-bloggers.com/simmer-v3-5-0-released-on-cran/" data-counturl="https://www.r-bloggers.com/simmer-v3-5-0-released-on-cran/" data-count="vertical" data-text="simmer v3.5.0 released on CRAN" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://fishyoperations.com/2016/10/27/simmer-v350-released-on-cran.html"> FishyOperations</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/AgQPCk-gGb0"></a></div>