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()
}

Try the petrinetR package in your browser

Any scripts or data that you put into this service are public.

petrinetR documentation built on April 3, 2023, 5:21 p.m.