User Manual, Developers Guide and API Documentation

MM1Step5.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 16, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #ifndef WNS_QUEUINGSYSTEM_MM1STEP5_HPP
00029 #define WNS_QUEUINGSYSTEM_MM1STEP5_HPP
00030 
00031 #include <WNS/queuingsystem/Job.hpp>
00032 
00033 #include <WNS/simulator/ISimulator.hpp>
00034 #include <WNS/simulator/ISimulationModel.hpp>
00035 #include <WNS/logger/Logger.hpp>
00036 #include <WNS/IOutputStreamable.hpp>
00037 #include <WNS/pyconfig/View.hpp>
00038 #include <WNS/distribution/Distribution.hpp>
00039 #include <WNS/distribution/DiscreteUniform.hpp>
00040 
00041 #include <WNS/probe/bus/ContextCollector.hpp>
00042 #include <WNS/probe/bus/ContextProviderCollection.hpp>
00043 
00044 #include <boost/bind.hpp>
00045 
00046 namespace wns { namespace queuingsystem {
00047 
00048     class SimpleMM1Step5 :
00049         public IOutputStreamable,
00050         public wns::simulator::ISimulationModel
00051     {
00052     public:
00053         explicit
00054         SimpleMM1Step5(const wns::pyconfig::View& configuration);
00055 
00056     private:
00057         virtual void
00058         doStartup();
00059 
00060         virtual void
00061         doShutdown();
00062 
00063         void
00064         generateNewJob();
00065 
00066         void
00067         onJobProcessed();
00068 
00069         void
00070         tryToProcessNextJob();
00071 
00072         void
00073         processNextJob();
00074 
00075         int
00076         getNumberOfJobs() const;
00077 
00078         Job
00079         getNextJob();
00080 
00081         virtual std::string
00082         doToString() const;
00083 
00084         Job::Priority
00085         drawJobPriority();
00086 
00087         int
00088         getCurrentJobPriority() const;
00089 
00090         wns::distribution::Distribution* jobInterarrivalTime_;
00091 
00092         wns::distribution::Distribution* jobProcessingTime_;
00093 
00094         wns::distribution::DiscreteUniform priorityDistribution_;
00095 
00096         std::list<Job> lowPriorityQueue_;
00097 
00098         std::list<Job> highPriorityQueue_;
00099 
00100         Job currentJob_;
00101 
00102         wns::pyconfig::View config_;
00103 
00104         wns::logger::Logger logger_;
00105 
00106         bool idle;
00107 
00108         // Used to obtain additional information for probed values
00109         wns::probe::bus::ContextProviderCollection* cpc_;
00110 
00111         // Used to probe the sojourn time
00112         wns::probe::bus::ContextCollector sojournTime_;
00113     };
00114 }
00115 }
00116 
00117 #endif // NOT defined WNS_QUEUINGSYSTEM_MM1STEP5_HPP
00118 

Generated on Fri May 25 03:31:52 2012 for openWNS by  doxygen 1.5.5