|
WSF
|
#include <WsfRIPRJobBoard.hpp>


Public Types | |
| enum | AllocationMode { Spread = 0 , Greedy = 1 , CoverThenGreedy = 2 , CoverThenSpread = 3 , StrictPriority = 4 } |
| Public Types inherited from WsfObject | |
| typedef std::vector< WsfStringId > | TypeList |
| The list of types returned by GetTypeList. | |
Public Member Functions | |
| WsfRIPRJobBoard () | |
| WsfRIPRJobBoard (const WsfRIPRProcessor *aOwnerPtr, bool aAutoExclusiveMode=false, double aJobWindowOpenLength=0, double aBidWindowOpenLength=0, bool aJobWindowOpen=true, bool aBidWindowOpen=true) | |
| WsfRIPRJobBoard (const WsfRIPRJobBoard &aSrc) | |
| Copy constructor (for Clone()). | |
| WsfRIPRJobBoard & | operator= (const WsfRIPRJobBoard &)=delete |
| WsfRIPRJobBoard * | Clone () const override |
| ~WsfRIPRJobBoard () override | |
| bool | DebugEnabled () const |
| Returns 'true' if debugging is enabled for this instance. | |
| void | AddJob (WsfRIPRJob *aJobPtr) |
| void | RemoveJob (WsfRIPRJob *aJobPtr) |
| void | RemoveAllJobs () |
| int | DeleteCompletedJobs (double aSimTime) |
| int | DeleteCompletedJobs () |
| int | PurgeUntouchedJobs () |
| int | PurgeUntouchedJobs (double aStaleTime) |
| void | CompletedJobsCallbacks (double simTime) |
| int | PurgeDeadBidders (double aSimTime) |
| void | SetOwner (const WsfRIPRProcessor *aOwnerPtr) |
| const WsfRIPRProcessor * | GetOwner () |
| std::list< WsfRIPRJob * > | GetJobs () |
| void | Update (double aSimTime) |
| Purge deleted jobs and bidders and reprioritize jobs if necessary. | |
| WsfRIPRJob * | JobFor (double aSimTime, unsigned int aBidderRIPRProcId) |
| WsfRIPRJob * | GetJobByData (std::string aDataKey, UtScriptData aDataValue) |
| WsfRIPRJob * | GetJobById (int aJobId) |
| std::map< unsigned int, WsfRIPRJob * > | GetWinnerList (const double aSimTime) |
| ripr::RIPRWinnerMap | GetWinnerListAsIds () const |
| void | AllocateJobs (double aSimTime, bool aForceReallocation) |
| void | AllocateJobs (bool aForceReallocation) |
| Allocates jobs with current sim time as the parameter. | |
| double | NormalizeBid (double) |
| AllocationMode | GetAllocationMode () |
| void | SetAllocationMode (AllocationMode aMode) |
| void | ClearBidsFor (double aSimTime, unsigned int aBidderRIPRProcId) |
| void | UpdateWindows (double aSimTime) |
| Update job and bid window status if necessary. | |
| void | SetAutoExclusiveMode (bool aAutoExclusiveMode) |
| void | SetJobWindowOpenLength (double aJobWindowOpenLength) |
| void | SetBidWindowOpenLength (double aBidWindowOpenLength) |
| bool | IsJobWindowOpen (double aSimTime) |
| bool | IsBidWindowOpen (double aSimTime) |
| void | SetJobWindowOpen (bool aOpen) |
| Sets mJobWindowOpen to aOpen; should be the ONLY place this value is set. | |
| void | SetBidWindowOpen (bool aOpen) |
| Sets mBidWindowOpen to aOpen; should be the ONLY place this value is set. | |
| void | SetJobStickiness (double aStickiness) |
| void | SetOwner (WsfRIPRProcessor *aOwnerPtr) |
| void | SetDirtyJobs () |
| void | UpdateMinMaxBids (double aBid) |
| void | SetPurgeTouchTime (double aPurgeTime) |
| double | PurgeTouchTime () |
| WsfSimulation * | GetSimulation () const |
| WsfRIPRManager * | GetManager () const |
| Public Member Functions inherited from WsfObject | |
| WsfObject () | |
| This is the constructor for the WsfObject class. | |
| ~WsfObject () override | |
| This is the destructor for the WsfObject class. | |
| const char * | GetScriptClassName () const override |
| virtual bool | ProcessInput (UtInput &aInput) |
| const std::string & | GetType () const |
| WsfStringId | GetTypeId () const |
| Get the string ID of the 'type' of the object. | |
| void | SetType (WsfStringId aType) |
| const std::string & | GetBaseType () const |
| WsfStringId | GetBaseTypeId () const |
| const TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (const WsfObject &aRhs) |
| Assignment operator. | |
| template<typename T> | |
| void | Serialize (T &aBuff) |
| For XIO (de)serialization. | |
| const std::string & | GetName () const |
| WsfStringId | GetNameId () const |
| void | SetName (WsfStringId aName) |
Static Public Member Functions | |
| static bool | CompareJobPriorities (WsfRIPRJob *firstPtr, WsfRIPRJob *secondPtr) |
| static std::map< int, std::set< int > > | DependenciesAll () |
| static std::set< int > & | DependenciesForJob (int aJobId) |
| static void | DependencyAdd (int aDependentJobId, int aDependedOnJobId) |
| static void | DependencyRemove (int aDependentJobId, int aDependedOnJobId) |
| static bool | DependencyCheck (int aDependentJobId, int aDependedOnJobId) |
| static int | DependencyCount (int aDependentJobId) |
| static void | DependencyClearAll () |
Protected Member Functions | |
| std::map< unsigned int, double > | AllocateJobsCover (double aSimTime, bool aStrictPriority=false) |
| void | AllocateJobsGreedy (double aSimTime) |
| void | AllocateJobsCoverThenGreedy (double aSimTime) |
| void | AllocateJobsCoverThenSpread (double aSimTime) |
| void | SetJobWon (const unsigned int aBidder, WsfRIPRJob *aJobPtr) |
| SetJobWon registers a job as being won and notifies the observer class. | |
| bool | BlockJobsWithoutMinWinners (std::list< WsfRIPRJob * > &aJobs, std::map< WsfRIPRJob *, int > &aCurWinners, std::set< int > &aBlockedJobs, std::map< unsigned int, WsfRIPRJob * > &aJobWinners, std::map< unsigned int, double > &aProcProfit) |
| check aJobs and block single highest priority unblocked job without the min number of winners | |
| bool | BlockJobsWithFailedDependencies (std::list< WsfRIPRJob * > &aJobs, std::map< WsfRIPRJob *, int > &aCurWinners, std::set< int > &aBlockedJobs, std::map< unsigned int, WsfRIPRJob * > &aJobWinners, std::map< unsigned int, double > &aProcProfit) |
| check aJobs and block single highest priority job that has failed or blocked dependencies | |
| bool | DependencyTest (WsfRIPRJob *aJobPtr, std::map< WsfRIPRJob *, int > &aCurWinners, std::set< int > &aBlockedJobs, std::set< int > &aKnownGood, std::set< int > &aVisitedJobs) |
| WsfObject (const WsfObject &aSrc) | |
| Copy constructor (for Clone()). | |
Protected Attributes | |
| const WsfRIPRProcessor * | mOwnerPtr |
| std::list< WsfRIPRJob * > | mJobs |
| bool | mJobPrioritiesChanged |
| std::map< unsigned int, WsfRIPRJob * > | mJobWinners |
| int | mAllocationAttempts |
| AllocationMode | mAllocationMode |
| double | mHighestBid |
| double | mLowestBid |
| bool | mAutoExclusiveMode |
| WsfRIPRJobBoard::WsfRIPRJobBoard | ( | ) |
References mAllocationAttempts, mAllocationMode, mAutoExclusiveMode, mHighestBid, mJobPrioritiesChanged, mJobs, mJobWinners, mLowestBid, mOwnerPtr, SetBidWindowOpen(), SetJobWindowOpen(), WsfObject::SetName(), WsfObject::SetType(), Spread, and WsfObject::WsfObject().
Referenced by Clone(), operator=(), and WsfRIPRJobBoard().
| WsfRIPRJobBoard::WsfRIPRJobBoard | ( | const WsfRIPRProcessor * | aOwnerPtr, |
| bool | aAutoExclusiveMode = false, | ||
| double | aJobWindowOpenLength = 0, | ||
| double | aBidWindowOpenLength = 0, | ||
| bool | aJobWindowOpen = true, | ||
| bool | aBidWindowOpen = true ) |
| WsfRIPRJobBoard::WsfRIPRJobBoard | ( | const WsfRIPRJobBoard & | aSrc | ) |
Copy constructor (for Clone()).
References WsfObject::GetName(), WsfObject::GetType(), mAllocationAttempts, mAllocationMode, mAutoExclusiveMode, mHighestBid, mJobPrioritiesChanged, mJobs, mJobWinners, mLowestBid, mOwnerPtr, SetBidWindowOpen(), SetJobWindowOpen(), WsfObject::SetName(), WsfObject::SetType(), WsfObject::WsfObject(), and WsfRIPRJobBoard().
|
override |
References mJobs.
| void WsfRIPRJobBoard::AddJob | ( | WsfRIPRJob * | aJobPtr | ) |
| void WsfRIPRJobBoard::AllocateJobs | ( | bool | aForceReallocation = false | ) |
Allocates jobs with current sim time as the parameter.
References AllocateJobs(), and GetSimulation().
| void WsfRIPRJobBoard::AllocateJobs | ( | double | aSimTime, |
| bool | aForceReallocation = false ) |
References AllocateJobsCover(), AllocateJobsCoverThenGreedy(), AllocateJobsCoverThenSpread(), AllocateJobsGreedy(), CoverThenGreedy, CoverThenSpread, GetManager(), WsfObject::GetNameId(), WsfRIPRManager::GetObserver(), GetOwner(), GetSimulation(), GetWinnerListAsIds(), Greedy, IsJobWindowOpen(), mAllocationMode, mHighestBid, mJobs, mLowestBid, Spread, StrictPriority, UpdateMinMaxBids(), and WsfRIPRObserver::WinnersReallocated.
Referenced by AllocateJobs(), GetWinnerList(), and JobFor().
|
protected |
References AllocateJobsCover().
Referenced by AllocateJobs(), AllocateJobsCover(), AllocateJobsCoverThenGreedy(), and AllocateJobsCoverThenSpread().
|
protected |
References AllocateJobsCover(), DebugEnabled(), WsfRIPRJob::GetBid(), GetManager(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfRIPRJob::GetPriority(), WsfRIPRManager::GetRiprProcById(), WsfRIPRJob::mDescription, mJobs, mJobWinners, NormalizeBid(), and SetJobWon().
Referenced by AllocateJobs().
|
protected |
References AllocateJobsCover(), DebugEnabled(), GetManager(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfRIPRManager::GetRiprProcById(), mJobs, and mJobWinners.
Referenced by AllocateJobs().
|
protected |
|
protected |
check aJobs and block single highest priority job that has failed or blocked dependencies
References DebugEnabled(), DependencyTest(), WsfRIPRJob::GetId(), GetManager(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfRIPRManager::GetRiprProcById(), WsfRIPRJob::mDescription, and SetJobWon().
|
protected |
check aJobs and block single highest priority unblocked job without the min number of winners
References DebugEnabled(), WsfRIPRJob::GetId(), GetManager(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfRIPRManager::GetRiprProcById(), WsfRIPRJob::GetWinnersMin(), WsfRIPRJob::mDescription, and SetJobWon().
| void WsfRIPRJobBoard::ClearBidsFor | ( | double | aSimTime, |
| unsigned int | aBidderRIPRProcId ) |
References IsJobWindowOpen(), mJobs, and SetDirtyJobs().
Referenced by UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().
|
inlineoverridevirtual |
Return a copy of this object. Must be implemented by all derived types. If cloning is impossible, a WsfUncloneableException should be thrown.
Implements WsfObject.
References WsfRIPRJobBoard().
|
static |
References WsfRIPRJob::GetPriority().
Referenced by Update().
| void WsfRIPRJobBoard::CompletedJobsCallbacks | ( | double | simTime | ) |
References GetManager(), WsfRIPRManager::GetObserver(), WsfRIPRObserver::JobCompleted, mJobs, and mOwnerPtr.
Referenced by Update().
| bool WsfRIPRJobBoard::DebugEnabled | ( | ) | const |
Returns 'true' if debugging is enabled for this instance.
References mOwnerPtr.
Referenced by AddJob(), AllocateJobsCoverThenGreedy(), AllocateJobsCoverThenSpread(), AllocateJobsGreedy(), BlockJobsWithFailedDependencies(), BlockJobsWithoutMinWinners(), DependencyTest(), RemoveAllJobs(), RemoveJob(), and UpdateWindows().
| int WsfRIPRJobBoard::DeleteCompletedJobs | ( | ) |
References DeleteCompletedJobs(), WsfSimulation::GetSimTime(), GetSimulation(), and simTime.
Referenced by DeleteCompletedJobs(), and Update().
| int WsfRIPRJobBoard::DeleteCompletedJobs | ( | double | aSimTime | ) |
References mJobs, RemoveJob(), and SetDirtyJobs().
|
inlinestatic |
|
inlinestatic |
Referenced by WsfRIPRJob::Dependencies().
|
inlinestatic |
Referenced by WsfRIPRJob::DependencyAdd().
|
inlinestatic |
References end().
Referenced by WsfRIPRJob::DependencyCheck().
|
inlinestatic |
Referenced by WsfRIPR_ModuleSetup::~WsfRIPR_ModuleSetup().
|
inlinestatic |
Referenced by WsfRIPRJob::DependencyCount().
|
inlinestatic |
Referenced by WsfRIPRJob::DependencyRemove().
|
protected |
|
inline |
References mAllocationMode.
| WsfRIPRJob * WsfRIPRJobBoard::GetJobByData | ( | std::string | aDataKey, |
| UtScriptData | aDataValue ) |
References WsfRIPRJob::mData, and mJobs.
| WsfRIPRJob * WsfRIPRJobBoard::GetJobById | ( | int | aJobId | ) |
References mJobs.
Referenced by DependencyTest(), WsfRIPRProcessor::JobFor(), and WsfRIPRProcessor::ProcessMessage().
| std::list< WsfRIPRJob * > WsfRIPRJobBoard::GetJobs | ( | ) |
References GetSimulation(), mJobs, and Update().
| WsfRIPRManager * WsfRIPRJobBoard::GetManager | ( | ) | const |
References mOwnerPtr.
Referenced by AddJob(), AllocateJobs(), AllocateJobsCoverThenGreedy(), AllocateJobsCoverThenSpread(), AllocateJobsGreedy(), BlockJobsWithFailedDependencies(), BlockJobsWithoutMinWinners(), CompletedJobsCallbacks(), PurgeDeadBidders(), RemoveAllJobs(), RemoveJob(), and SetJobWon().
|
inline |
References mOwnerPtr.
Referenced by AllocateJobs().
| WsfSimulation * WsfRIPRJobBoard::GetSimulation | ( | ) | const |
References mOwnerPtr.
Referenced by AddJob(), AllocateJobs(), AllocateJobs(), DeleteCompletedJobs(), GetJobs(), PurgeUntouchedJobs(), RemoveAllJobs(), RemoveJob(), and SetJobWon().
| std::map< unsigned int, WsfRIPRJob * > WsfRIPRJobBoard::GetWinnerList | ( | const double | aSimTime | ) |
Returns a list of winners (referenced by WsfRIPRProcessor::Id()) and the job they have been assigned to.
References AllocateJobs(), IsJobWindowOpen(), and mJobWinners.
| ripr::RIPRWinnerMap WsfRIPRJobBoard::GetWinnerListAsIds | ( | ) | const |
Returns a list of winners (referenced by WsfRIPRProcessor::GetId()) and the id of the job they have been assigned to.
References mJobWinners.
Referenced by AllocateJobs().
| bool WsfRIPRJobBoard::IsBidWindowOpen | ( | double | aSimTime | ) |
References UpdateWindows().
Referenced by AddJob().
| bool WsfRIPRJobBoard::IsJobWindowOpen | ( | double | aSimTime | ) |
References UpdateWindows().
Referenced by AllocateJobs(), ClearBidsFor(), GetWinnerList(), and JobFor().
| WsfRIPRJob * WsfRIPRJobBoard::JobFor | ( | double | aSimTime, |
| unsigned int | aBidderRIPRProcId ) |
References AllocateJobs(), IsJobWindowOpen(), and mJobWinners.
Referenced by WsfRIPRProcessor::JobFor().
| double WsfRIPRJobBoard::NormalizeBid | ( | double | aBid | ) |
References mHighestBid, and mLowestBid.
Referenced by AllocateJobsCoverThenGreedy(), and AllocateJobsGreedy().
|
delete |
References WsfRIPRJobBoard().
| int WsfRIPRJobBoard::PurgeDeadBidders | ( | double | aSimTime | ) |
References WsfPlatform::GetDamageFactor(), GetManager(), WsfPlatformPart::GetPlatform(), WsfRIPRManager::GetRiprProcById(), mJobs, and SetDirtyJobs().
Referenced by Update().
|
inline |
| int WsfRIPRJobBoard::PurgeUntouchedJobs | ( | ) |
References PurgeUntouchedJobs().
Referenced by PurgeUntouchedJobs().
| int WsfRIPRJobBoard::PurgeUntouchedJobs | ( | double | aStaleTime | ) |
References WsfSimulation::GetSimTime(), GetSimulation(), mJobs, RemoveJob(), and SetDirtyJobs().
| void WsfRIPRJobBoard::RemoveAllJobs | ( | ) |
| void WsfRIPRJobBoard::RemoveJob | ( | WsfRIPRJob * | aJobPtr | ) |
References DebugEnabled(), GetManager(), WsfRIPRManager::GetObserver(), GetSimulation(), WsfRIPRObserver::JobRemoved, WsfRIPRJob::mDescription, mJobs, and SetDirtyJobs().
Referenced by DeleteCompletedJobs(), and PurgeUntouchedJobs().
|
inline |
References mAllocationMode.
|
inline |
References mAutoExclusiveMode.
| void WsfRIPRJobBoard::SetBidWindowOpen | ( | bool | aOpen | ) |
Sets mBidWindowOpen to aOpen; should be the ONLY place this value is set.
References mJobs.
Referenced by UpdateWindows(), WsfRIPRJobBoard(), WsfRIPRJobBoard(), and WsfRIPRJobBoard().
|
inline |
|
inline |
|
inline |
| void WsfRIPRJobBoard::SetJobWindowOpen | ( | bool | aOpen | ) |
Sets mJobWindowOpen to aOpen; should be the ONLY place this value is set.
Referenced by UpdateWindows(), WsfRIPRJobBoard(), WsfRIPRJobBoard(), and WsfRIPRJobBoard().
|
inline |
|
protected |
SetJobWon registers a job as being won and notifies the observer class.
References GetManager(), WsfRIPRManager::GetObserver(), GetSimulation(), WsfRIPRObserver::JobWon, and mJobWinners.
Referenced by AllocateJobsCoverThenGreedy(), BlockJobsWithFailedDependencies(), and BlockJobsWithoutMinWinners().
|
inline |
References mOwnerPtr.
|
inline |
References mOwnerPtr.
|
inline |
| void WsfRIPRJobBoard::Update | ( | double | aSimTime = 0 | ) |
Purge deleted jobs and bidders and reprioritize jobs if necessary.
References CompareJobPriorities(), CompletedJobsCallbacks(), DeleteCompletedJobs(), mJobPrioritiesChanged, mJobs, PurgeDeadBidders(), and UpdateWindows().
Referenced by AllocateJobsGreedy(), and GetJobs().
| void WsfRIPRJobBoard::UpdateMinMaxBids | ( | double | aBid | ) |
References mHighestBid, and mLowestBid.
Referenced by AllocateJobs(), and WsfRIPRJob::BidJob().
| void WsfRIPRJobBoard::UpdateWindows | ( | double | aSimTime | ) |
Update job and bid window status if necessary.
References DebugEnabled(), mAutoExclusiveMode, SetBidWindowOpen(), and SetJobWindowOpen().
Referenced by IsBidWindowOpen(), IsJobWindowOpen(), and Update().
|
protected |
Referenced by WsfRIPRJobBoard(), WsfRIPRJobBoard(), and WsfRIPRJobBoard().
|
protected |
Referenced by AllocateJobs(), GetAllocationMode(), SetAllocationMode(), WsfRIPRJobBoard(), WsfRIPRJobBoard(), and WsfRIPRJobBoard().
|
protected |
Referenced by SetAutoExclusiveMode(), UpdateWindows(), WsfRIPRJobBoard(), WsfRIPRJobBoard(), and WsfRIPRJobBoard().
|
protected |
Referenced by AllocateJobs(), NormalizeBid(), UpdateMinMaxBids(), WsfRIPRJobBoard(), WsfRIPRJobBoard(), and WsfRIPRJobBoard().
|
protected |
Referenced by AddJob(), Update(), WsfRIPRJobBoard(), WsfRIPRJobBoard(), and WsfRIPRJobBoard().
|
protected |
Referenced by AddJob(), AllocateJobs(), AllocateJobsCoverThenGreedy(), AllocateJobsCoverThenSpread(), AllocateJobsGreedy(), ClearBidsFor(), CompletedJobsCallbacks(), DeleteCompletedJobs(), GetJobByData(), GetJobById(), GetJobs(), PurgeDeadBidders(), PurgeUntouchedJobs(), RemoveAllJobs(), RemoveJob(), SetBidWindowOpen(), Update(), WsfRIPRJobBoard(), WsfRIPRJobBoard(), WsfRIPRJobBoard(), and ~WsfRIPRJobBoard().
|
protected |
|
protected |
Referenced by AllocateJobs(), NormalizeBid(), UpdateMinMaxBids(), WsfRIPRJobBoard(), WsfRIPRJobBoard(), and WsfRIPRJobBoard().
|
protected |
Referenced by CompletedJobsCallbacks(), DebugEnabled(), GetManager(), GetOwner(), GetSimulation(), SetOwner(), SetOwner(), WsfRIPRJobBoard(), WsfRIPRJobBoard(), and WsfRIPRJobBoard().