R/preset.R

Defines functions pre_set.petrinet pre_set

Documented in pre_set

#' @title Preset
#'
#' @description Get the preset of a transition or place in a Petri Net
#'
#' @param node \code{\link{character}} of length one: the node id for which to get the postset.
#' @inheritParams flows
#'
#' @export pre_set

pre_set <- function(PN, node) {
	UseMethod("pre_set")
}

pre_set.petrinet <- function(PN, node) {
	(flows(PN) %>% filter(to == node))$from %>% return()
}
bupaverse/petrinetR documentation built on April 23, 2023, 10:41 p.m.