R/is_nodes.R

Defines functions is_node

Documented in is_node

#' @title Is node
#'
#' @description Check if a node is part of a petri net
#'
#' @param node \code{\link{character}} of length one: the node id to check.
#' @param PN \code{\link{petrinet}} or \code{\link{marked_petrinet}}
#'
#' @return logical that indicates whether \code{node} is a node in \code{PN}
#' @export is_node

is_node <- function(node, PN) {

	if(node %in% transitions(PN)$id)
		return(T)
	else if(node %in% places(PN)$id)
		return(T)
	else
		return(F)
}

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.