Skip to content

Arrival attributes are not cloned #118

@Enchufa2

Description

@Enchufa2

Example:

library(simmer)

t1 <- trajectory() %>%
  set_attribute("index", 1) %>%
  clone(
    n = 2,
    trajectory("Original") %>%
      set_attribute("index", function() get_attribute(env, "index") + 1),
    trajectory("MW") %>%
      timeout(1) %>%
      set_attribute("index", function() get_attribute(env, "index") + 1)
  ) %>%
  synchronize(wait = TRUE, mon_all = FALSE) 

env <- simmer() %>%
  add_generator("asdf", t1, at(0), mon=2)

env %>%
  run() %>%
  get_mon_attributes()
#>   time  name   key value replication
#> 1    0 asdf0 index     1           1
#> 2    0 asdf0 index     2           1
#> 3    1 asdf0 index    NA           1

NA should be 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions