WSF
WsfRIPRJobBoard Class Reference

#include <WsfRIPRJobBoard.hpp>

Inheritance diagram for WsfRIPRJobBoard:
Collaboration diagram for WsfRIPRJobBoard:

Public Types

enum  AllocationMode {
  Spread = 0 , Greedy = 1 , CoverThenGreedy = 2 , CoverThenSpread = 3 ,
  StrictPriority = 4
}
Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 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()).
WsfRIPRJobBoardoperator= (const WsfRIPRJobBoard &)=delete
WsfRIPRJobBoardClone () 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 WsfRIPRProcessorGetOwner ()
std::list< WsfRIPRJob * > GetJobs ()
void Update (double aSimTime)
 Purge deleted jobs and bidders and reprioritize jobs if necessary.
WsfRIPRJobJobFor (double aSimTime, unsigned int aBidderRIPRProcId)
WsfRIPRJobGetJobByData (std::string aDataKey, UtScriptData aDataValue)
WsfRIPRJobGetJobById (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 ()
WsfSimulationGetSimulation () const
WsfRIPRManagerGetManager () 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 TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (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 WsfRIPRProcessormOwnerPtr
std::list< WsfRIPRJob * > mJobs
bool mJobPrioritiesChanged
std::map< unsigned int, WsfRIPRJob * > mJobWinners
int mAllocationAttempts
AllocationMode mAllocationMode
double mHighestBid
double mLowestBid
bool mAutoExclusiveMode

Member Enumeration Documentation

◆ AllocationMode

Enumerator
Spread 
Greedy 
CoverThenGreedy 
CoverThenSpread 
StrictPriority 

Constructor & Destructor Documentation

◆ WsfRIPRJobBoard() [1/3]

◆ WsfRIPRJobBoard() [2/3]

WsfRIPRJobBoard::WsfRIPRJobBoard ( const WsfRIPRProcessor * aOwnerPtr,
bool aAutoExclusiveMode = false,
double aJobWindowOpenLength = 0,
double aBidWindowOpenLength = 0,
bool aJobWindowOpen = true,
bool aBidWindowOpen = true )

◆ WsfRIPRJobBoard() [3/3]

◆ ~WsfRIPRJobBoard()

WsfRIPRJobBoard::~WsfRIPRJobBoard ( )
override

References mJobs.

Member Function Documentation

◆ AddJob()

◆ AllocateJobs() [1/2]

void WsfRIPRJobBoard::AllocateJobs ( bool aForceReallocation = false)

Allocates jobs with current sim time as the parameter.

References AllocateJobs(), and GetSimulation().

◆ AllocateJobs() [2/2]

◆ AllocateJobsCover()

std::map< unsigned int, double > WsfRIPRJobBoard::AllocateJobsCover ( double aSimTime,
bool aStrictPriority = false )
protected

◆ AllocateJobsCoverThenGreedy()

◆ AllocateJobsCoverThenSpread()

void WsfRIPRJobBoard::AllocateJobsCoverThenSpread ( double aSimTime)
protected

◆ AllocateJobsGreedy()

◆ BlockJobsWithFailedDependencies()

bool WsfRIPRJobBoard::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 )
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().

◆ BlockJobsWithoutMinWinners()

bool WsfRIPRJobBoard::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 )
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().

◆ ClearBidsFor()

void WsfRIPRJobBoard::ClearBidsFor ( double aSimTime,
unsigned int aBidderRIPRProcId )

◆ Clone()

WsfRIPRJobBoard * WsfRIPRJobBoard::Clone ( ) const
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().

◆ CompareJobPriorities()

bool WsfRIPRJobBoard::CompareJobPriorities ( WsfRIPRJob * firstPtr,
WsfRIPRJob * secondPtr )
static

References WsfRIPRJob::GetPriority().

Referenced by Update().

◆ CompletedJobsCallbacks()

void WsfRIPRJobBoard::CompletedJobsCallbacks ( double simTime)

◆ DebugEnabled()

bool WsfRIPRJobBoard::DebugEnabled ( ) const

◆ DeleteCompletedJobs() [1/2]

int WsfRIPRJobBoard::DeleteCompletedJobs ( )

◆ DeleteCompletedJobs() [2/2]

int WsfRIPRJobBoard::DeleteCompletedJobs ( double aSimTime)

References mJobs, RemoveJob(), and SetDirtyJobs().

◆ DependenciesAll()

std::map< int, std::set< int > > WsfRIPRJobBoard::DependenciesAll ( )
inlinestatic

◆ DependenciesForJob()

std::set< int > & WsfRIPRJobBoard::DependenciesForJob ( int aJobId)
inlinestatic

◆ DependencyAdd()

void WsfRIPRJobBoard::DependencyAdd ( int aDependentJobId,
int aDependedOnJobId )
inlinestatic

◆ DependencyCheck()

bool WsfRIPRJobBoard::DependencyCheck ( int aDependentJobId,
int aDependedOnJobId )
inlinestatic

References end().

Referenced by WsfRIPRJob::DependencyCheck().

◆ DependencyClearAll()

void WsfRIPRJobBoard::DependencyClearAll ( )
inlinestatic

◆ DependencyCount()

int WsfRIPRJobBoard::DependencyCount ( int aDependentJobId)
inlinestatic

◆ DependencyRemove()

void WsfRIPRJobBoard::DependencyRemove ( int aDependentJobId,
int aDependedOnJobId )
inlinestatic

◆ DependencyTest()

bool WsfRIPRJobBoard::DependencyTest ( WsfRIPRJob * aJobPtr,
std::map< WsfRIPRJob *, int > & aCurWinners,
std::set< int > & aBlockedJobs,
std::set< int > & aKnownGood,
std::set< int > & aVisitedJobs )
protected

◆ GetAllocationMode()

AllocationMode WsfRIPRJobBoard::GetAllocationMode ( )
inline

References mAllocationMode.

◆ GetJobByData()

WsfRIPRJob * WsfRIPRJobBoard::GetJobByData ( std::string aDataKey,
UtScriptData aDataValue )

References WsfRIPRJob::mData, and mJobs.

◆ GetJobById()

WsfRIPRJob * WsfRIPRJobBoard::GetJobById ( int aJobId)

◆ GetJobs()

std::list< WsfRIPRJob * > WsfRIPRJobBoard::GetJobs ( )

References GetSimulation(), mJobs, and Update().

◆ GetManager()

◆ GetOwner()

const WsfRIPRProcessor * WsfRIPRJobBoard::GetOwner ( )
inline

References mOwnerPtr.

Referenced by AllocateJobs().

◆ GetSimulation()

◆ GetWinnerList()

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.

◆ GetWinnerListAsIds()

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().

◆ IsBidWindowOpen()

bool WsfRIPRJobBoard::IsBidWindowOpen ( double aSimTime)

References UpdateWindows().

Referenced by AddJob().

◆ IsJobWindowOpen()

bool WsfRIPRJobBoard::IsJobWindowOpen ( double aSimTime)

◆ JobFor()

WsfRIPRJob * WsfRIPRJobBoard::JobFor ( double aSimTime,
unsigned int aBidderRIPRProcId )

◆ NormalizeBid()

double WsfRIPRJobBoard::NormalizeBid ( double aBid)

◆ operator=()

WsfRIPRJobBoard & WsfRIPRJobBoard::operator= ( const WsfRIPRJobBoard & )
delete

References WsfRIPRJobBoard().

◆ PurgeDeadBidders()

int WsfRIPRJobBoard::PurgeDeadBidders ( double aSimTime)

◆ PurgeTouchTime()

double WsfRIPRJobBoard::PurgeTouchTime ( )
inline

◆ PurgeUntouchedJobs() [1/2]

int WsfRIPRJobBoard::PurgeUntouchedJobs ( )

References PurgeUntouchedJobs().

Referenced by PurgeUntouchedJobs().

◆ PurgeUntouchedJobs() [2/2]

int WsfRIPRJobBoard::PurgeUntouchedJobs ( double aStaleTime)

◆ RemoveAllJobs()

◆ RemoveJob()

◆ SetAllocationMode()

void WsfRIPRJobBoard::SetAllocationMode ( AllocationMode aMode)
inline

References mAllocationMode.

◆ SetAutoExclusiveMode()

void WsfRIPRJobBoard::SetAutoExclusiveMode ( bool aAutoExclusiveMode)
inline

References mAutoExclusiveMode.

◆ SetBidWindowOpen()

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().

◆ SetBidWindowOpenLength()

void WsfRIPRJobBoard::SetBidWindowOpenLength ( double aBidWindowOpenLength)
inline

◆ SetDirtyJobs()

◆ SetJobStickiness()

void WsfRIPRJobBoard::SetJobStickiness ( double aStickiness)
inline

◆ SetJobWindowOpen()

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().

◆ SetJobWindowOpenLength()

void WsfRIPRJobBoard::SetJobWindowOpenLength ( double aJobWindowOpenLength)
inline

◆ SetJobWon()

void WsfRIPRJobBoard::SetJobWon ( const unsigned int aBidder,
WsfRIPRJob * aJobPtr )
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().

◆ SetOwner() [1/2]

void WsfRIPRJobBoard::SetOwner ( const WsfRIPRProcessor * aOwnerPtr)
inline

References mOwnerPtr.

◆ SetOwner() [2/2]

void WsfRIPRJobBoard::SetOwner ( WsfRIPRProcessor * aOwnerPtr)
inline

References mOwnerPtr.

◆ SetPurgeTouchTime()

void WsfRIPRJobBoard::SetPurgeTouchTime ( double aPurgeTime)
inline

◆ Update()

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().

◆ UpdateMinMaxBids()

void WsfRIPRJobBoard::UpdateMinMaxBids ( double aBid)

References mHighestBid, and mLowestBid.

Referenced by AllocateJobs(), and WsfRIPRJob::BidJob().

◆ UpdateWindows()

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().

Member Data Documentation

◆ mAllocationAttempts

int WsfRIPRJobBoard::mAllocationAttempts
protected

◆ mAllocationMode

◆ mAutoExclusiveMode

bool WsfRIPRJobBoard::mAutoExclusiveMode
protected

◆ mHighestBid

double WsfRIPRJobBoard::mHighestBid
protected

◆ mJobPrioritiesChanged

bool WsfRIPRJobBoard::mJobPrioritiesChanged
protected

◆ mJobs

◆ mJobWinners

◆ mLowestBid

double WsfRIPRJobBoard::mLowestBid
protected

◆ mOwnerPtr


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved