![]() |
User Manual, Developers Guide and API Documentation |
![]() |
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_MM1STEP3_HPP 00029 #define WNS_QUEUINGSYSTEM_MM1STEP3_HPP 00030 00031 #include <WNS/queuingsystem/Job.hpp> 00032 00033 #include <WNS/rng/RNGen.hpp> 00034 #include <WNS/simulator/ISimulator.hpp> 00035 #include <WNS/simulator/ISimulationModel.hpp> 00036 #include <WNS/logger/Logger.hpp> 00037 #include <WNS/IOutputStreamable.hpp> 00038 #include <WNS/pyconfig/View.hpp> 00039 00040 #include <WNS/probe/bus/ContextCollector.hpp> 00041 #include <WNS/probe/bus/ContextProviderCollection.hpp> 00042 #include <WNS/distribution/Distribution.hpp> 00043 00044 #include <boost/bind.hpp> 00045 00046 namespace wns { namespace queuingsystem { 00047 00048 class SimpleMM1Step3 : 00049 public IOutputStreamable, 00050 public wns::simulator::ISimulationModel 00051 { 00052 typedef wns::rng::VariateGenerator< boost::exponential_distribution<> > Exponential; 00053 public: 00054 explicit 00055 SimpleMM1Step3(const wns::pyconfig::View& configuration); 00056 00057 private: 00058 virtual void 00059 doStartup(); 00060 00061 virtual void 00062 doShutdown(); 00063 00064 void 00065 generateNewJob(); 00066 00067 void 00068 onJobProcessed(); 00069 00070 void 00071 tryToProcessNextJob(); 00072 00073 void 00074 processNextJob(); 00075 00076 virtual std::string 00077 doToString() const; 00078 00079 // begin example "wns.queuingsystem.mm1step3.hpp.example" 00080 wns::distribution::Distribution* jobInterarrivalTime_; 00081 00082 wns::distribution::Distribution* jobProcessingTime_; 00083 00084 std::list<Job> queue_; 00085 00086 wns::pyconfig::View config_; 00087 00088 wns::logger::Logger logger_; 00089 00090 // Used to obtain additional information for probed values 00091 wns::probe::bus::ContextProviderCollection cpc_; 00092 00093 // Used to probe the sojourn time 00094 wns::probe::bus::ContextCollector sojournTime_; 00095 // end example 00096 }; 00097 } 00098 } 00099 00100 #endif // NOT defined WNS_QUEUINGSYSTEM_MM1STEP3_HPP 00101
1.5.5