Wiki

Clone wiki

ArchEx / Getting started with ArchEx

Running a demo problem

To check that ArchEx is installed and configured correctly, you can run one of the demo problems. We currently have demos for electrical power distribution networks (EPN) and reconfigurable production lines (RPL). Please refer to corresponding wiki pages for running them. Demo problems run in a relatively silent mode (with minimum verbose from the solver) and perform all steps: problem creation, calling the solver, viewing and saving the results.

ArchEx control script

To create and solve an architecture exploration problem, type following in the matlab console:

ArchEx(problem_type, library_file, problem_file)

specifying the type of your problem (string) and the names of TXT files that store the library and the problem description. These files must be put to, respectively, Libraries and Problems folders. Currently, two problem types are supported, use "EPN" and "RPL" as problem_type to create an instance of, respectively, EPN and RPL problem.

This script automatically includes all necessary folders to the Matlab path, creates an instance of a corresponding problem and solves it. Resulting architecture graph will be shown and problem data will be saved to disk. Problem object is stored in the Matlab workspace, it is possible to explore its contents (public properties) by typing

prob

During the execution ArchEx does some console prints, which allows to see what it is currently doing.

Small problems

There are some predefined problems provided with ArchEx 2.0 release, for example small instances with rather few nodes. If you want to try one of them out, uncomment a corresponding row in the debug section (see below) for creating the problem object (and comment all others) in the ArchEx.m script. Such small problems are particularly useful for regression testing as well as getting started (they can be quickly solved with both monolithic and iterative optimization strategies).

Debug mode

ArchEx has a debug mode, which does not call the solver after formulating the problem (all actions have to be performed by the user by typing corresponding commands). To use the debug mode, you have to modify the ArchEx.m control script. These is a debug section there, which looks like this:

#!matlab

if debug   
    tic
    prob = EPNProblem('TEST EPN PROBLEM', 'demos/DEMO_EPN_LIB.txt', 'EPN_test.txt', 'lazy');
    %prob = RPLProblem('TEST RPL PROBLEM', 'RPL_library.txt', 'RPL_test.txt', 'eager');  

    % smaller problems for regression testing
    %prob = EPNProblem('TEST EPN PROBLEM (small)', 'EPN_library_small.txt', 'EPN_test_small.txt', 'lazy');        
    %prob = RPLProblem('TEST RPL PROBLEM (small)', 'RPL_library.txt', 'RPL_test_small.txt', 'eager');

You can use this part to create an instance of an EPN or RPL problem with your own input. Put your file names (problem description and library) as parameters to one of these commands (keeping others commented out) and create the problem instance by typing

ArchEx

with no parameters. In this case the tool will create the problem object and define all constraints present in the problem description file. The solver will not be called automatically so one can check certain object properties, if they were created correctly or not etc. One can also use the debugging system of matlab (breakpoints etc.) to follow the program flow and see how the formulation is done.

Solving

The solver can be then called by typing

prob.Solve(options)

in the console. Options parameter specifies the settings of the solver used (e.g., timeout, optimization gap and so on). It is optional and can be omitted. In the latter case the default options set for the current solver strategy ("eager" or "lazy") will be used. For more information on configuring/tuning the solver please refer here.

Showing results

After solving, the resulting graph will be automatically shown. The mappings of the nodes to the library components can be seen by double-clicking on them. A small window will open showing the characteristics of the corresponding library component. In the graph window you can also increase/decrease node and font size for better visibility and change layouts. Current version, however, supports only one layout for nice visualization of results and it is shown by default. Future versions of ArchEx will support more layouts if required.

If you have accidentally closed the graph window, you can draw the graph again by typing

prob.ShowResult

Saving

ArchEx can save the results to files. If you type

prob.Save

then the graph will be saved to a PNG file and some matlab data (including the execution time, value of the cost function, results of analysis, requirement values and so on) will be saved to MAT file. The only thing that will not be saved are the decision variables ("sdpvar" objects). Also, ArchEx saves CPLEX input data to a TXT file, so one can see the number of constraints and variables.

Changing solver strategy

ArchEx implements several strategies for solving MILP. Currently EPN problems support both monolithic ("eager") and iterative ("lazy") strategies, while RPL problems support only "eager". You can choose the strategy by typing

prob.setAlgorithm(<algorithm>)

where <algorithm> is a string and can be either "eager" or "lazy". If currently selected strategy requires creating extra decision variables and constraints (e.g., reliability constraints in the EPN problem for monolithic optimization), then they will be automatically created and stored in the problem. Default solving strategy is "eager" (though this can be modified by the developer for his/her own problem class).

Updated