Comments (5)
+1
Simple shortcut off the top of my head; save the seized number as an attribute with an uncommon prefix. In the first example above set e.g. an attribute ___seized__dummy
with value 3
(in the background of-course). This can then be easily retrieved to release the correct amount. This does however incur an overhead (if you want to increment the seized amount you have to pass the attributes
to the R side). Depending on the overhead incurred by monitoring the seized amount (in this shortcut style or by a robust c++ implementation), maybe only allow this from a given monitoring level.
In terms of syntax, it might require a different command like release_all(resource)
. As seize(resource)
defaults to an amount of 1
it isn't unlogical that release(resource)
also defaults to an amount of 1
.
from simmer.
I have plans for this.
from simmer.
Any educated guesses on how this would impact the run-time of larger simulations?
from simmer.
It should be minimal because a map is similar to a hash table. It will be even smaller when we use an unordered_map from Boost or C++11 (this is in the TODO list).
from simmer.
This is a good time to reopen this, because the enhancements implemented in the last year provide the required infrastructure to address it trivially.
Instead of changing release("resource")
and release_selected()
's default amount
, one solution would be to create another couple of verbs, release_all("resource")
and release_selected_all()
. But maybe release_all()
is more intuitive for releasing the whole amount in every resource seized, which would be a nice addition too. For instance:
traj <- trajectory() %>%
seize("dummy1", 3) %>%
seize("dummy2") %>%
timeout(1) %>%
release_all()
Feelings, @Bart6114?
from simmer.
Related Issues (20)
- Using scheduling objects and parallelise simmer runs HOT 1
- Trajectory printing has a cap on the number of nested branches
- Get batch size
- Renege-timer error "not previously seized" HOT 4
- Implement arithmetic for schedules
- Use 'given' in CITATION
- Ability to deep-copy simulation environments
- synchronize() not work as expected HOT 3
- Monitors do not register the finalizer
- Dangling environment prevents object destruction HOT 1
- Bank Tutorial Part II: Balking - finished=TRUE even though balked HOT 1
- Batch cloning doesn't clone individual arrivals
- Caller misidentification
- Add support for vectors of capacities, queue sizes... HOT 2
- Airport control security HOT 1
- Option to add wait() time to activity_time
- Option to trap() "all" signals instead of "any"
- Possible Bug? `per_resource = T` drops the `finished` variable in `get_mon_arrivals()` HOT 3
- download version from CRAN does not recognise "tag" argument. HOT 6
- Output options are too limited HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simmer.