Ports
Port(name, description='')
Base class for all ports.
Ports are key to the definition of ported objects. A ported object can be thought of as a container for some information. A port exposes some of that information, labeled by an identifier, to the exterior of that object.
Different implementations of ports expose different information in different ways.
Warning
The Port
class should not be instantiated directly.
Note
The name of a port uniquely determines its symbol. The symbol only has relevance in two cases:
-
Input port symbols for
VariablePortedObject
andFunctionalPortedObject
instances. In this case, the symbol may appear in expressions defined within those objects, and input values will be substituted into it. -
Variable port symbols when the variable port is not connected on the outside. This symbol will then become globally associated to the variable that is simulated in the system.
PARAMETER | DESCRIPTION |
---|---|
name
|
the identifier of a port associated to a
TYPE:
|
description
|
a description of the contents of a port
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
if an invalid name is given. By default, this is any string containing a period |
Source code in psymple/build/ports.py
InputPort(name, description='', default_value=None)
OutputPort(name, description='')
Bases: Port
An output port is a port exposing a system parameter which can be read from.
Source code in psymple/build/ports.py
VariablePort(name, description='')
Bases: Port
A variable port is a port exposing a system variable.