Changes between Version 21 and Version 22 of TopdlLibrary


Ignore:
Timestamp:
Oct 8, 2012 3:34:50 PM (7 years ago)
Author:
faber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TopdlLibrary

    v21 v22  
     1[[TOC]]
     2
    13= Topdl Library =
    24
     
    4951
    5052Most classes can have attributes attached to them that contain extention attributes that different applications make use of.  The presence or absence of an optional nested object does not mean the presence or absence of the thing it describes, but that the description is unbound.  As [TopDl#Representation we have seen] a Computer without a nested CPU object does not describe a computer without a CPU, but a computer with no constraints on the CPU.
     53
     54Most of the nested classes can appear multiple times.  This is to allow application designers to express as many interesting topologies as possible without having to redefine topdl.  Interfaces can be members of more than one substrate because substrates are intended to be general enough to capture unusual communications media - e.g., interfaces with different line-of-sight connectivity.  Similarly, we expect most computers to have one operating system, but want to allow some applications to express multi-boot or virtual machine capabilities.
    5155 
    5256=== Adaptive Constructors ===
     
    623627== Annotating A Topology ==
    624628
    625 The first step in out transformation is to take a topology and add attributes that will be used by other applications.  In our example, the other applications will be further refinements in the same program.
    626 
    627 Here is a function that walks a topology, determines the degree of each computer, and adds an [TopdlLibrary#AttributeClass attribute] to each computer with that attribute in it.  It demostrates editing a topology using the [TopdlLibrary#TopdlClassFeatures set_attribute] function  common to topdl classes.
     629The first step in our transformation is to take a topology and add attributes that will be used by other applications.  In our example, the other applications will be further refinements in the same program.
     630
     631Here is a function that walks a topology, determines the degree of each computer, and adds an [TopdlLibrary#AttributeClass attribute] to each computer with that degree in it.  It demostrates editing a topology using the [TopdlLibrary#TopdlClassFeatures set_attribute] function  common to topdl classes.
    628632
    629633{{{
     
    795799}}}
    796800
    797 == Putting it all together ==
     801== Putting It All Together ==
     802
     803The complete example is [attachment:example.py attached to this page.]  It consists of :
     804
     805 * Parsing an input and output filename from the command line
     806 * Reading a topology from the input filename (you can use [attachment:topo.xml the example]).
     807 * Calling the topology manipulation subroutines developed above in sequence
     808 * Calling the ns2 output routine above using the output filename
     809
     810This is by no means the most efficient way to change the initial topology to the final topology; it was organized this way to demonstrate the various features.  There is sample [attachment: out.tcl ns2 output] attached as well.
     811
     812The intent of the examples is to give you a starting point for using the topdl library.  If you have questions or comments, [mailto:faber@isi.edu contact us].