MLDO Module DotModule
From EVOCD
Ports
| Port type | Java name | Port Name | packet type | Associated Variable | Intended connection |
| Input ports: | |||||
| inport | IN | String | RouterSlip | Loop Module | |
| Output ports: | |||||
| outport | OUT1 | String | RouterSlip | DotModule or End_of_loop | |
| endPort | OUT2 | String | "error" | Error_Stop | |
Synopsis
- Process Routing Slip
- Write initial.txt file
- Write const.txt file
- Run Dot
- IF (return value==0) Update values of the design variables and update values of the link variable(s)
- IF (return value==0) send updated Routing Slip to outport ELSE send "error" to endPort
Details
Process Routing Slip
- Split the incoming string by " ". It is expected to have at least two elements; if not set returnValue to -1 (prohibiting the execution of the rest of the module)
- The first is the identifier of the Dot instance: system. Convert it to integer; if this fails, set returnValue to -1 (prohibiting the execution of the rest of the module)
- Update slip by calling SystemStatus.updateRouterSlip(String[]) which removes the fist element and concatenates the remainding element into a single String.
Write initial.txt
requires improvement
- creates three Vectors<String> to store lb, initial value, and ub for each design variable
- uses hardwired values for lb=0.0 and ub=10.0
- the initial values are taken by invoking Strong iv[] = SystemState.getSubsystemVaraiblesValues(system)
- write file using FileUtil.writeInputFile(configuration.systems[system]+"/initial.txt", lb, initvalues,ub), where initvalue is a Vector converted from String[] iv
Write const.txt
requires improvement
- write file using FileUtil.Values2File(SystemState.getConstantValues(system),configuration.systems[system]+"/const.txt");
- write to stdout values of SystemState.lambda, SystemState.W, and SystemState.link_up which is wrong
Run Dot
- Dot myDotRun = new Dot(system)
- returnValue = myDotRun.runDot
Update Design Variables and Link Variables
- Vector<String> myOutput = FileUtil.getDotResults(configuration.systems[system]+"/result.txt")
- convert Vector myOutput to String[] x
- SystemState.updateSubsystemVaraibleValues(system,x)
- SystemState.updateLinkVariables(system) which requires an improvement