Skip to content

Implement post.seize and reject subtrajectories in seize #49

Description

@Enchufa2

Many models require an arrival to do something if it gets rejected when trying to seize a resource. So we need something in between a seize and a branch: an ifseize activity would work similarly to the R function ifelse. For instance,

ifseize(traj, resource, amount = 1, retry = FALSE, merge = c(TRUE, TRUE),
           yes = NULL, 
           no = NULL,
           priority = 0, preemptible = 0, restart = FALSE)

Use case: a WiFi station trying to seize the wireless channel to transmit a frame:

frame <- create_trajectory() %>%
  timeout(backoff) %>%
  ifseize("channel", 1, retry=7, merge=c(T, T),
          yes = create_trajectory() %>%
            timeout(send_frame) %>%
            release("channel", 1),
          no = create_trajectory() %>%
            timeout(backoff))

@bart6114, review this proposal, please.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions