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

Begin system with customers #98

Open
geraintpalmer opened this issue Dec 1, 2016 · 3 comments
Open

Begin system with customers #98

geraintpalmer opened this issue Dec 1, 2016 · 3 comments
Labels

Comments

@geraintpalmer
Copy link
Member

Artificially insert customer into the simulation.

@drvinceknight
Copy link
Contributor

Good idea. Would this have the potential to simplify tests too?

For example, to test baulking, start a system with a full set of customers and see that no joins for example.

@geraintpalmer
Copy link
Member Author

Batch arrivals.

Equivalent to time dependent batch arrivals, where at time 0 hundreds of customers arrive.

@galenseilis
Copy link
Contributor

Artificially insert customer into the simulation.

This would be exceptionally useful for simulating real systems where the initial state needs to match an existing data set of waitlists. A method that takes in a collection of individuals to be put onto specified queues would be a desirable way to do it. A list of lists might be consistent with the rest of the

An example with a single service might look like this:

import ciw

list_of_initial_waiters = [[Individual(...), Individual(...), Individual(...)]]

N = ciw.create_network(
    arrival_distributions=[ciw.dists.Deterministic(value=3.0)],
    service_distributions=[ciw.dists.Deterministic(value=0.5)],
    number_of_servers=[1],
    initial_individuals=list_of_initial_waiters
)

And an example with two queues might look like this:

import ciw

list_of_initial_waiters = [ # Note that the lengths of the queues do not need to equal.
                                              [Individual(...), Individual(...), Individual(...)] # Queue 1
                                              [Individual(...), Individual(...)] # Queue 2
                                         ] 

N = ciw.create_network(
    arrival_distributions=[ciw.dists.Deterministic(value=3.0), ciw.dists.Deterministic(value=3.0)],
    service_distributions=[ciw.dists.Deterministic(value=0.5), ciw.dists.Deterministic(value=0.5)],
    number_of_servers=[1],
    initial_individuals=list_of_initial_waiters
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants