102 | | A list of [TopdlLibrary#SubstrateClass Substrate objects] |
| 104 | A list of [TopdlLibrary#SubstrateClass Substrate objects] that contain the substrates of the topology. The list may be empty indicating no communcations are possible. |
| 105 | {{{elements}}}:: |
| 106 | A list of entities make up the network. These can be of any [TopdlLibrary#ComputerClass Computer objects], [TopdlLibrary#TestbedClass Testbed objects], [TopdlLibrary#SegmentClass Segment objects], or [TopdlLibrary#OtherClass Other objects]. The list may be empty indicating no elements are in the topology. |
| 107 | {{{attribute}}}::: |
| 108 | A list of [TopdlLibrary#AttributeObject Attribute objects] that are attached to the machine. The list may be empty. |
| 109 | {{{version}}}:: |
| 110 | The version of topdl that this object encodes. |
| 111 | |
| 112 | As usual, the constructor takes the member names as parameter names. |
| 113 | |
| 114 | One useful specialized member is: |
| 115 | |
| 116 | {{{ |
| 117 | incorporate_elements(self) |
| 118 | }}} |
| 119 | |
| 120 | That member sanity checks the substrates to make sure they are uniquely named, assigns names to any interfaces without them, and connects the {{{element}}} members of the [TopdlLibrary#InterfaceObject Interface objects]. If there are inconsistencies, it raises a {{{topdl.ConsistencyError}}} with more detail in the message. |
| 121 | |
| 122 | {{{incorporate_elements()}}} is called by the {{{Topology}}} constructor as well and that constructor may throw the same exceptions. |
| 158 | A {{{Computer}}} should only be an element of one {{{Topology}}}. Use {{{clone()}}} to avoid this. |
| 159 | |
| 160 | == Substrate Object == |
| 161 | |
| 162 | The {{{Substrate}}} object represents a communication substrate. The elements that have interfaces connected to a substrate can communicate with one another. A {{{Substrate}}} may include default parameters for the latency and capacity of the communication channel. |
| 163 | |
| 164 | The members are: |
| 165 | |
| 166 | {{{name}}}:: |
| 167 | A string, the unique name of the substrate. |
| 168 | {{{capacity}}:: |
| 169 | A [TopdlLibrary#Capacity Capacity object] that gives the default capacity of the substrate. It may be None, incdicating that there is no default. |
| 170 | {{{latency}}:: |
| 171 | A [TopdlLibrary#Latency Latency object] that gives the default latency of the substrate. It may be None, incdicating that there is no default. |
| 172 | {{{attribute}}}:: |
| 173 | A list of [TopdlLibrary#AttributeObject Attribute objects] that are attached to the substrate. The list may be empty. |
| 174 | {{{localname}}}:: |
| 175 | A list of strings giving alternative names for the object. The list may be empty, meaning no such alternatives exist. |
| 176 | {{{status}}}:: |
| 177 | A string indicating the current status of the Computer (if any). It may also be None, indicating no status is reported. Valid values are |
| 178 | * "empty" - no allocation of resources has been attempted - generally not applied to Substrates |
| 179 | * "active" - Substrate is functioning as part of an experiment |
| 180 | * "inactive" - Substrate is allocated, but not functioning |
| 181 | * "starting" - Substrate is transitioning from "inactive" to "active" |
| 182 | * "terminating" - Substrate is transitioning from "active" to "inactive" |
| 183 | * "failed" - an allocation of resources has failed - generally not applied to Substrates |
| 184 | {{{service}}}:: |
| 185 | A list of [TopdlLibrary#ServiceObject Service objects] that describe the services this substrate uses or supplies. These are generally used by the federation system, and their definition is somewhat in flux. The list may be empty. |
| 186 | {{{operation}}}:: |
| 187 | A list of strings that describe the valid operations on the substrate. These are generally used by the federation system, and their definition is somewhat in flux.The list may be empty. |
| 188 | {{{interfaces}}}:: |
| 189 | A list of [TopdlLibrary#InterfaceObject Interface objects] connected to this substrate. The list may be empty, meaning that the substrate is not connected to any elements. This field is maintained by the [TopdlLibrary#TopologyObject Topology object] holding this Substrate object. '''It is not a parameter to the constructor.''' |
| 190 | |
| 191 | Other than {{{interfaces}}}, the constructor takes the member names as parameters. Only the {{{name}}} is required. |
| 192 | |
| 193 | Because the enclosing {{{Topology}}} object maintains the {{{interfaces}}} member, it is dangerous to have the same {{{Substrate}}} object in more than one {{{Topology}}}. Use the {{{clone()}}} method to avoid this. |