Comments (9)
The problem with Deque
is that it does not allow to delete an arbitrary element.
I have used a Store
only with mutable objects. For immutable type we have that a==b
is identical to a===b
.
One way I can solve this, is boxing immutable types...
from concurrentsim.jl.
Boxing immutable objects or using a Dict with as key the object and as value the number of times it is stored. Both are doable. I have a slight preference for the latter. All input is welcome!
from concurrentsim.jl.
I had some spare time;) straightforward implementation of a Store based on a Dict is in the master branch.
julia> using SimJulia
julia> env = Simulation()
Simulation time: 0.0 active_process: nothing
julia> store = Store{Symbol}(env)
Store{Symbol}
julia> put(store, :apple)
SimJulia.Put 1
julia> put(store, :apple)
SimJulia.Put 2
julia> put(store, :pear)
SimJulia.Put 3
julia> store.items
Dict{Symbol, UInt64} with 2 entries:
:pear => 0x0000000000000001
:apple => 0x0000000000000002
What do you think?
from concurrentsim.jl.
I agree! Closed
from concurrentsim.jl.
Sorry for the late answer ... SimJulia had a low priority but it will be better in the future;)
A Dequeue
is more logical. I will implement it.
from concurrentsim.jl.
What is the path forward here?
from concurrentsim.jl.
I definitely vote for the latter as well. I'm not a fan of boxing and using a dictionary would make it clear how many items you have.
from concurrentsim.jl.
Looks great. I've started using this already. Unless you think it needs further work, I think we can close this issue.
from concurrentsim.jl.
I've been using this new implementation and it works great for my purposes. Unless @riccardosven suggests otherwise, we should close this issue.
from concurrentsim.jl.
Related Issues (20)
- Support for Discrete Time HOT 5
- TagBot trigger issue HOT 8
- Rank priority function in StorePutKey
- Polling a resource / poor-mans spinlock HOT 4
- Citation reference? HOT 1
- Add API Functions for process and resource state inspection
- TODO: Transparent statistics gathering for resources HOT 1
- document similarities and differences with DiscreteEvents.jl
- add downstream breakage tests to CI
- set documentation builder to error on warnings (and clear up all the warnings)
- enable preemption of jobs HOT 1
- use the typical Base functions instead of declaring new ones (e.g. `get`, `put`, `release`, etc) HOT 1
- document difference between Resource, Store, and Container
- verify all basic types are concrete (and consider using sumtypes where possible)
- Error when building documentation HOT 2
- Try - catch bad for performance in Julia. HOT 1
- port SimJulia.jl 'school' example and add description of that to the docs HOT 3
- refresh the examples folder: clean up, rewrite, test, and add to CI
- add benchmarks to CI
- documentation reorganizing
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 concurrentsim.jl.