![]() |
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-2009 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, 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 #include <WNS/scheduler/strategy/dsastrategy/InterferenceCoordinatedSimple.hpp> 00029 #include <WNS/scheduler/strategy/dsastrategy/DSAStrategyInterface.hpp> 00030 #include <WNS/scheduler/SchedulerTypes.hpp> 00031 #include <vector> 00032 #include <iostream> 00033 #include <algorithm> 00034 00035 using namespace wns::scheduler; 00036 using namespace wns::scheduler::strategy; 00037 using namespace wns::scheduler::strategy::dsastrategy; 00038 00039 STATIC_FACTORY_REGISTER_WITH_CREATOR(InterferenceCoordinatedSimple, 00040 DSAStrategyInterface, 00041 "InterferenceCoordinatedSimple", 00042 wns::PyConfigViewCreator); 00043 00044 InterferenceCoordinatedSimple::InterferenceCoordinatedSimple(const wns::pyconfig::View& config) 00045 : DSAStrategy(config) 00046 { 00047 //useRandomChannelAtBeginning = config.get<bool>("useRandomChannelAtBeginning"); 00048 } 00049 00050 InterferenceCoordinatedSimple::~InterferenceCoordinatedSimple() 00051 { 00052 } 00053 00054 // call this before each timeSlot/frame 00055 void 00056 InterferenceCoordinatedSimple::initialize(SchedulerStatePtr schedulerState, 00057 SchedulingMapPtr schedulingMap) 00058 { 00059 DSAStrategy::initialize(schedulerState,schedulingMap); // must always initialize base class too 00060 // just a SmartPtr: 00061 //ChannelQualitiesOfAllUsersPtr 00062 assure(schedulerState->currentState!=RevolvingStatePtr(),"currentState must be valid"); 00063 // set member: 00064 channelQualitiesOfAllUsers = 00065 schedulerState->currentState->channelQualitiesOfAllUsers; 00066 // useful for interference/neighbor cell coordinated strategies: 00067 // typedef std::list<wns::node::Interface*> NodeList; 00068 // typedef wns::node::Interface* wns::scheduler::UserID 00069 // TODO: 00070 // 1) put this into RegistryProxyInterface 00071 // 2) make filter in RegistryProxy for NodeType BS 00072 // 3) find a way to get direct neighbors only (adjacent, geometrically) 00073 // 4) Find a way to get neighbor scheduler/strategy/state 00074 // 5) Let neighbors communicate about their decisions (using a Singleton?) 00075 } 00076 00077 DSAResult 00078 InterferenceCoordinatedSimple::getSubChannelWithDSA(RequestForResource& request, 00079 SchedulerStatePtr schedulerState, 00080 SchedulingMapPtr schedulingMap) 00081 { 00082 DSAResult dsaResult; 00083 /* TODO */ 00084 assure(false,"InterferenceCoordinatedSimple: not yet implemented"); 00085 return dsaResult; // empty with subChannel=DSAsubChannelNotFound 00086 } 00087
1.5.5