Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vague unscrutable error messages on construction of Container and Resource #131

Open
venushastri92 opened this issue Sep 20, 2024 · 1 comment

Comments

@venushastri92
Copy link

Describe the problem

using ConcurrentSim
env = Simulation()
Container(env, capacity = 100, level = 31)

Simply running this throws me an error :
UndefVarError: N not defined

Stacktrace:
[1] top-level scope
@ In[1]:4

It might be associated with the container parameter N. Please help me resolve this issue.

@Krastanov
Copy link
Member

Hi! Thanks for reporting this!

For Container you need to specify the data type that would be used explicitly. One of these two options should work for you though:

julia> Container{Int,Int}(env, 100, level = 31)
Resource

julia> Resource(env, 100, level = 31) # implicitly a Int-containing Container
Resource

Of note is that both constructors have capacity as a default argument, not a keyword argument, so Resource(env, capacity = 100, level = 31) would actually raise an error.

Both of these need fixing, so I will leave this issue open:

  • better error message when Container is not given a type parameter (maybe simply a better constructor)
  • better constructor for when capacity is given as a keyword argument (maybe @kwdef too) for Resource and Container

@Krastanov Krastanov changed the title Unable to initialize the Container when using ConcurrentSim v1.4.1 and julia 1.10.5 Vague unscrutable error messages on construction of Container and Resource Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants