Stream: helpdesk (published)

Topic: Custom Type 'Resource'


view this post on Zulip QuBit (Apr 04 2021 at 11:51):

Hello Everyone:

Stage:
Windows 10 64-bit
Julia v 1.6.0
IDE: Pluto 0.14x
using SimJulia, Distributions

Does anyone know what the 'Resource' data type
has been updated to (from version 0.6.x)?

The dataypes are defined as:

function visit(customer::Process,
        time_at_barber::Float64,
        counter::Resource,
        max_in_queue::Int)
    arrive = now(customer);

I am attempting to execute a counter
as part of the following instructions

seed=100;
rand(seed);
    sim = Simulation(Int(16));
    k = Resource(sim, "Counter", Int8(1), false);
    s = Process(sim, "Source");
    activate(s,
             0.0,
             generate,
             max_number,
             mean_prep_time,
             mean_haircut_time,
             k,
             max_queue);

And am returning:

UndefVarError: Resource not defined

The goal is to:

run(sim, max_time)

Any suggestions?

view this post on Zulip Kwaku Oskin (Apr 04 2021 at 12:01):

Presumably it was defined earlier in the tutorial where you took this snippet.

view this post on Zulip QuBit (Apr 04 2021 at 12:04):

Andrey Oskin

I did not qualify the 'Resource' method.
Now, the new error is:

no method matching SimJulia.Resource(::Int64, ::String, ::Int64, ::Bool)

Last updated: Nov 06 2024 at 04:40 UTC