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

Scheduling infinite capacity does not behave the same as a very large one #60

Closed
Enchufa2 opened this Issue Jun 7, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@Enchufa2
Member

Enchufa2 commented Jun 7, 2016

Reported by @nacnudus:

library(simmer)

arrival <- 
  create_trajectory("Arrival trajectory") %>%
  seize("server") %>%
  release("server")

schedule1 <- schedule(c(3, 100), c(999, 0))
schedule2 <- schedule(c(3, 100), c(Inf, 0))

## Model/Experiment ------------------------------

set.seed(393939)
env <- 
  simmer() %>%
  add_resource("server", capacity = schedule1) %>%
  add_generator("Arrival", arrival, at(1:9))
env %>% run(until = 12)
#> simmer environment: anonymous | now: 100 | next: 
#> { Resource: server | monitored: 1 | server status: 0(0) | queue status: 0(Inf) }
#> { Generator: Arrival | monitored: 1 | n_generated: 9 }
env %>% get_mon_resources
#>    time server queue system resource replication
#> 1     1      0     1      1   server           1
#> 2     2      0     2      2   server           1
#> 3     3      2     0      2   server           1
#> 4     3      1     0      1   server           1
#> 5     3      0     0      0   server           1
#> 6     3      1     0      1   server           1
#> 7     3      0     0      0   server           1
#> 8     4      1     0      1   server           1
#> 9     4      0     0      0   server           1
#> 10    5      1     0      1   server           1
#> 11    5      0     0      0   server           1
#> 12    6      1     0      1   server           1
#> 13    6      0     0      0   server           1
#> 14    7      1     0      1   server           1
#> 15    7      0     0      0   server           1
#> 16    8      1     0      1   server           1
#> 17    8      0     0      0   server           1
#> 18    9      1     0      1   server           1
#> 19    9      0     0      0   server           1
#> 20  100      0     0      0   server           1

set.seed(393939)
env <- 
  simmer() %>%
  add_resource("server", capacity = schedule2) %>%
  add_generator("Arrival", arrival, at(1:9))
env %>% run(until = 12)
#> simmer environment: anonymous | now: 100 | next: 
#> { Resource: server | monitored: 1 | server status: 0(0) | queue status: 0(Inf) }
#> { Generator: Arrival | monitored: 1 | n_generated: 9 }
env %>% get_mon_resources
#>    time server queue system resource replication
#> 1     1      0     1      1   server           1
#> 2     2      0     2      2   server           1
#> 3     3      0     2      2   server           1
#> 4     3      1     2      3   server           1
#> 5     3      2     0      2   server           1
#> 6     3      1     0      1   server           1
#> 7     3      0     0      0   server           1
#> 8     4      1     0      1   server           1
#> 9     4      0     0      0   server           1
#> 10    5      1     0      1   server           1
#> 11    5      0     0      0   server           1
#> 12    6      1     0      1   server           1
#> 13    6      0     0      0   server           1
#> 14    7      1     0      1   server           1
#> 15    7      0     0      0   server           1
#> 16    8      1     0      1   server           1
#> 17    8      0     0      0   server           1
#> 18    9      1     0      1   server           1
#> 19    9      0     0      0   server           1
#> 20  100      0     0      0   server           1

@Enchufa2 Enchufa2 added the bug label Jun 7, 2016

@Enchufa2 Enchufa2 closed this in d300f90 Jun 7, 2016

@Enchufa2 Enchufa2 added this to the v3.3.0 milestone Jun 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment