![]() |
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_GGN_HPP 00029 #define WNS_QUEUINGSYSTEM_GGN_HPP 00030 00031 #include <WNS/simulator/ISimulationModel.hpp> 00032 #include <WNS/distribution/Distribution.hpp> 00033 00034 #include <WNS/logger/Logger.hpp> 00035 #include <WNS/pyconfig/View.hpp> 00036 00037 #include <WNS/queuingsystem/Job.hpp> 00038 #include <WNS/queuingsystem/Server.hpp> 00039 00040 #include <WNS/probe/bus/ContextCollector.hpp> 00041 #include <WNS/probe/bus/ContextProviderCollection.hpp> 00042 00043 #include <list> 00044 00045 namespace wns { namespace queuingsystem { 00046 00047 class GGn : 00048 public wns::simulator::ISimulationModel 00049 { 00050 public: 00051 explicit 00052 GGn(const wns::pyconfig::View& configuration); 00053 00054 virtual 00055 ~GGn(); 00056 00057 void 00058 onJobProcessed(Job); 00059 00060 bool 00061 hasJob(Server*); 00062 00063 Job 00064 getJob(); 00065 00066 protected: 00067 virtual void 00068 doStartup(); 00069 00070 virtual void 00071 doShutdown(); 00072 00073 virtual void 00074 onCreateJob(); 00075 00076 void 00077 nextJob(); 00078 00079 wns::distribution::Distribution* interArrivalDist_; 00080 wns::distribution::Distribution* processingTimeDist_; 00081 00082 int serverCount_; 00083 00084 std::vector<Server*> servers_; 00085 std::list<Server*> emptyServers_; 00086 std::list<Job> queue_; 00087 00088 wns::probe::bus::ContextProviderCollection cpc_; 00089 wns::probe::bus::ContextCollector queueSize_; 00090 wns::probe::bus::ContextCollector processingTime_; 00091 wns::probe::bus::ContextCollector sojournTime_; 00092 wns::probe::bus::ContextCollector waitingTime_; 00093 00094 wns::logger::Logger logger_; 00095 }; 00096 } 00097 } 00098 00099 #endif // NOT defined WNS_QUEUINGSYSTEM_GGN_HPP
1.5.5