Giter Club home page Giter Club logo

Comments (9)

BenLauwens avatar BenLauwens commented on June 15, 2024 1

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.

BenLauwens avatar BenLauwens commented on June 15, 2024 1

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.

BenLauwens avatar BenLauwens commented on June 15, 2024 1

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.

riccardosven avatar riccardosven commented on June 15, 2024 1

I agree! Closed

from concurrentsim.jl.

BenLauwens avatar BenLauwens commented on June 15, 2024

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.

hdavid16 avatar hdavid16 commented on June 15, 2024

What is the path forward here?

from concurrentsim.jl.

hdavid16 avatar hdavid16 commented on June 15, 2024

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.

hdavid16 avatar hdavid16 commented on June 15, 2024

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.

hdavid16 avatar hdavid16 commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.