modelling-tasks-0.0.0.1
Safe HaskellSafe-Inferred
LanguageHaskell2010

Modelling.PetriNet.Diagram

Description

Provides the ability to render Petri nets.

Synopsis

Documentation

cacheNet Source #

Arguments

:: (Data (n String), Data (p n String), MonadCache m, MonadDiagrams m, MonadGraphviz m, MonadThrow m, Net p n, Typeable n, Typeable p) 
=> FilePath

a prefix to use for resulting files

-> p n String

the graph to draw

-> DrawSettings

how to draw the graph

-> m FilePath 

Uses cache in order to cache the provided Petri net like graph (Net). by distributing places and transitions using GraphViz. The provided GraphvizCommand is used for this distribution.

drawNet Source #

Arguments

:: (MonadDiagrams m, MonadGraphviz m, MonadThrow m, Net p n) 
=> p n String

the graph definition

-> DrawSettings

how to draw the graph

-> m (Diagram B) 

Create a Diagrams graph of a Petri net like graph definition (Net) by distributing places and transitions using GraphViz. The provided GraphvizCommand is used for this distribution.

getDefaultNet :: (MonadThrow m, Net p n) => AlloyInstance -> m (p n String) Source #

getNet :: (MonadThrow m, Net p n, Traversable t) => (AlloyInstance -> m (t Object)) -> AlloyInstance -> m (p n String, t String) Source #

isNetDrawable Source #

Arguments

:: (MonadCatch m, MonadDiagrams m, MonadGraphviz m, Net p n) 
=> p n String

the net to attempt to draw

-> DrawSettings

settings to use

-> m Bool 

Attempts to draw the net. As Graphviz might fail to layout the net, this function indicates such failure by returning False if that is the case or True in case of success.