Patterns

EPHS.PatternsModule

The Patterns module defines interconnection Patterns, which provide a graphical syntax for expressing a power-preserving interconnection of finitely many subsystems into a single composite system. Since subsystems may again have yet simpler subsystems, patterns can be composed, i.e. hierarchically nested. Whenever the outer interface of a pattern matches a subsystem interface of another pattern, the patterns can be composed.

source
EPHS.Patterns.InnerBoxType
InnerBox(ports::Dtry{InnerPort}, filling::F, position::P) where {{F<:Union{Nothing,AbstractSystem},P<:Union{Nothing,Position}}

An InnerBox represents a subsystem, whose Interface is given as a directory of ports, see InnerPort.

To define systems hierarchically, a filling is assigned, which is a system whose interface matches that of the box.

Fields

source
EPHS.Patterns.InnerBoxMethod
InnerBox(ports::Dtry{InnerPort}, filling::AbstractSystem, position::Position)

An InnerBox represents a subsystem, whose Interface is given as a directory of ports, see InnerPort.

To define systems hierarchically, a filling is assigned, which is a system whose interface matches that of the box.

source
EPHS.Patterns.InnerBoxMethod
InnerBox(ports::Dtry{InnerPort}, filling::AbstractSystem)

An InnerBox represents a subsystem, whose Interface is given as a directory of ports, see InnerPort.

To define systems hierarchically, a filling is assigned, which is a system whose interface matches that of the box.

source
EPHS.Patterns.InnerPortType
InnerPort(junction::DtryPath, power::Bool)

An InnerPort is a port of an InnerBox, which is connected to the Junction with the given DtryPath in the directory of junctions, see Pattern. If power=false the port is a state port, which may exchange information about the state of the quantity associated to the junction. If power=true the port is a power port, which may additionally exchange energy by exchanging the associated quantity.

Fields

  • junction: DtryPath to the assigned junction
  • power: false means state port, true means power port
source
EPHS.Patterns.InnerPortMethod
InnerPort(junction::DtryPath; power::Bool=true)

An InnerPort is a port of an InnerBox, which is connected to the Junction with the given DtryPath in the directory of junctions, see Pattern. If power=false the port is a state port, which may exchange information about the state of the quantity associated to the junction. If power=true the port is a power port, which may additionally exchange energy by exchanging the associated quantity.

source
EPHS.Patterns.JunctionType
Junction{P}(quantity::Quantity, position::P, exposed::Bool, power::Bool) where {P<:Union{Nothing,Position}}

A junction represents an energy domain, where the connected ports may exchange information about the state of the given quantity and where the connected power ports may additionally exchange energy by exchanging the given quantity. If exposed=true an outer port is added, which is a power port if power=true.

Fields

  • quantity: associated Quantity
  • position: nothing or a grid Position
  • exposed: true means the junction has a connected outer port
  • power: if exposed, determines if the outer port is a power port
source
EPHS.Patterns.JunctionMethod
Junction(quantity::Quantity, position::Position; exposed::Bool=false, power::Bool=true)

A junction represents an energy domain, where the connected ports may exchange information about the state of the given quantity and where the connected power ports may additionally exchange energy by exchanging the given quantity. If exposed=true an outer port is added, which is a power port if power=true.

source
EPHS.Patterns.JunctionMethod
Junction(quantity::Quantity; exposed::Bool=false, power::Bool=true)

A junction represents an energy domain, where the connected ports may exchange information about the state of the given quantity and where the connected power ports may additionally exchange energy by exchanging the given quantity. If exposed=true an outer port is added, which is a power port if power=true.

source
EPHS.Patterns.PatternType
Pattern{F,P}(junctions::Dtry{Junction{P}}, boxes::Dtry{InnerBox{F,P}}) where {F<:Union{Nothing,AbstractSystem},P<:Union{Nothing,Position}}

A (interconnection) Pattern is defined by a directory of (possibly exposed) Junctions and a directory of InnerBoxes (subsystems), whose ports are assigned to junctions, see InnerPort. The constructor checks that

  • junctions and boxes have disjoint namespaces
  • every port is connected/assigned to an existing junction
  • every junction has at least one connected inner port

Fields

  • junctions: directory of junctions
  • boxes: directory of inner boxes (subsystems)
source
EPHS.Patterns.PatternMethod
Pattern{Nothing,Nothing}(pattern::Pattern{F,P})

Reduce a Pattern{F,P} to a Pattern{Nothing,Nothing} by forgetting the filling of boxes as well as the positions of junctions and boxes.

source
EPHS.Patterns.PatternMethod
Pattern(junctions::Dtry{Junction{P}}, boxes::Dtry{InnerBox{F,P}}) where {F<:Union{Nothing,AbstractSystem},P<:Union{Nothing,Position}}

A (interconnection) Pattern is defined by a directory of (possibly exposed) Junctions and a directory of InnerBoxes (subsystems), whose ports are assigned to junctions, see InnerPort. The constructor checks that

  • junctions and boxes have disjoint namespaces
  • every port is connected/assigned to an existing junction
  • every junction has at least one connected inner port
source
EPHS.Patterns.composeMethod
compose(pattern::Pattern{Nothing,Nothing}, fillings::Dtry{Pattern{Nothing,Nothing}}) -> Pattern{Nothing,Nothing}

Composition operation for the Dtry-multicategory of patterns.

Arguments

  • pattern: top-level Pattern
  • fillings: directory of patterns, which assigns to each InnerBox of the top-level pattern a nested pattern
source