OpticalGraph.h revision 10447:a465576671d4
1#ifndef __DSENT_MODEL_OPTICALGRAPH_OPTICALGRAPH_H__
2#define __DSENT_MODEL_OPTICALGRAPH_OPTICALGRAPH_H__
3
4#include <vector>
5
6#include "util/CommonType.h"
7#include "model/optical_graph/OpticalNode.h"
8
9namespace DSENT
10{
11    class OpticalNode;
12    class OpticalWavelength;
13
14    class OpticalGraph
15    {
16        public:
17            // The visited number for the next timing run. This needs to be
18            // global because several timing trees may be created to evaluate
19            // a single timing path, causing problems
20            static int msTreeNum;
21
22        public:
23            // Construct timing tree that watches over model_
24            OpticalGraph(const String& instance_name_, OpticalModel* model_);
25            ~OpticalGraph();
26
27        public:
28            // Get graph name
29            const String& getInstanceName() const;
30            // Perform datapath power optimization by balancing insertion loss and extinction
31            // ratio with modulator/receiver and laser power, returns false if there are no
32            // designs that are possible
33            bool performPowerOpt(OpticalNode* node_, const WavelengthGroup& wavelengths_, unsigned int number_detectors_, double util_);
34            // Recursively trace a wavelength starting from an OpticalLaser
35            // source finding all lasers, modulators and detectors that a
36            // wavelength group hits.
37            OpticalWavelength* traceWavelength(const WavelengthGroup& wavelengths_, OpticalNode* node_);
38            OpticalWavelength* traceWavelength(OpticalWavelength* wavelength_, OpticalNode* node_, OpticalLaser* laser_, OpticalModulator* modulator_, double loss_);
39            // Return the model
40            OpticalModel* getModel();
41
42        private:
43
44            // Disable the use of copy constructor
45            OpticalGraph(const OpticalGraph& graph_);
46
47        public:
48            // Set the sequence number of the optical graph
49            static void setTreeNum(int tree_num_);
50            static int getTreeNum();
51
52        private:
53            // Name of the optical graph
54            const String m_instance_name_;
55            // A pointer to the model that contains this node
56            OpticalModel* m_model_;
57
58    }; // class OpticalGraph
59} // namespace DSENT
60
61#endif // __DSENT_MODEL_OPTICALGRAPH_OPTICALGRAPH_H__
62
63