RingModulator.h revision 10448:bc1a3b7ab5ef
1/* Copyright (c) 2012 Massachusetts Institute of Technology
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
9 *
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 * THE SOFTWARE.
20 */
21
22#ifndef __DSENT_MODEL_OPTICAL_RINGMODULATOR_H__
23#define __DSENT_MODEL_OPTICAL_RINGMODULATOR_H__
24
25#include "util/CommonType.h"
26#include "model/OpticalModel.h"
27#include "model/optical_graph/OpticalTransmitter.h"
28
29namespace DSENT
30{
31    class RingModulator : public OpticalModel, public OpticalTransmitter
32    {
33        public:
34            RingModulator(const String& instance_name_, const TechModel* tech_model_);
35            virtual ~RingModulator();
36
37        public:
38            // Set a list of properties' name needed to construct model
39            void initParameters();
40            // Set a list of properties' name needed to construct model
41            void initProperties();
42            // Set the transmitter specifications, returns whether it is possible
43            // to build a modulator that met those specs
44            bool setTransmitterSpec(double IL_dB_, double ER_dB_);
45            // Returns power of the transmitter at a given utilization
46            double getPower(double util_) const;
47
48        private:
49            // Precompute values based on tech parameters
50            void precomputeTech();
51            // Design ring modulator driver
52            bool designModulator(double IL_dB_, double ER_dB_);
53            // Calculate modulator energy
54            double calcModulatorEnergy() const;
55
56        protected:
57            // Build the model
58            virtual void constructModel();
59            virtual void updateModel();
60            virtual void useModel();
61            virtual void propagateTransitionInfo();
62
63        private:
64            // Some precomputed tech values
65            double m_precompute_V_bi_;
66            double m_precompute_x_d0_;
67            double m_precompute_C_j0_;
68            double m_precompute_Q_0_;
69
70
71    }; // class RingModulator
72} // namespace DSENT
73
74#endif // __DSENT_MODEL_OPTICAL_RINGMODULATOR_H__
75
76