55 lines
2.1 KiB
C++
Executable File
55 lines
2.1 KiB
C++
Executable File
|
|
#pragma once
|
|
|
|
#include <wfr/common/types/WfrTypes.h>
|
|
#include <wfr/common/resource/ResourceReservation.h>
|
|
#include <wfr/prediction/PredictionManager.h>
|
|
|
|
namespace wfr {
|
|
namespace wfs {
|
|
class ActivityInstance;
|
|
class AtomicActivityImplementation;
|
|
}
|
|
namespace wep {
|
|
class WorkflowExecutionPlan;
|
|
}
|
|
|
|
|
|
namespace scheduling {
|
|
|
|
class SchedulingDecision {
|
|
|
|
// Invariant properties that can be accessed directly.
|
|
public:
|
|
wfs::ActivityInstance* const activityInstance = nullptr;
|
|
wfs::AtomicActivityImplementation* const activityImplementation = nullptr;
|
|
wep::WorkflowExecutionPlan* const wep = nullptr;
|
|
resource::ComputingResource* const resource = nullptr;
|
|
resource::ComputingResourceReservation reservationHandle;
|
|
wfr_size_t slotCount = 0;
|
|
|
|
// Mutable properties that need to be accessed via getter-/setter-functions.
|
|
// Some of them are invariant, but this class needs to be copyable, so no const properties :(
|
|
private:
|
|
prediction::ExecutionTimeResult prediction;
|
|
|
|
// Public functions
|
|
public:
|
|
SchedulingDecision(wfs::ActivityInstance* activityInstance, wfs::AtomicActivityImplementation* activityImplementation,
|
|
wep::WorkflowExecutionPlan* wep, resource::ComputingResourceReservation reservationHandle) noexcept
|
|
: activityInstance(activityInstance), activityImplementation(activityImplementation), wep(wep),
|
|
resource(reservationHandle.resource), reservationHandle(reservationHandle), slotCount(reservationHandle.slotCount) {}
|
|
SchedulingDecision(wfs::ActivityInstance* activityInstance, wfs::AtomicActivityImplementation* activityImplementation,
|
|
wep::WorkflowExecutionPlan* wep, resource::ComputingResource* resource = nullptr, const wfr_size_t& slotCount = 1) noexcept
|
|
: activityInstance(activityInstance), activityImplementation(activityImplementation), wep(wep),
|
|
resource(resource), slotCount(slotCount) {}
|
|
~SchedulingDecision() noexcept {}
|
|
|
|
const prediction::ExecutionTimeResult& getPrediction() const noexcept { return prediction; }
|
|
void setPrediction(const prediction::ExecutionTimeResult& prediction) noexcept { this->prediction = prediction; }
|
|
};
|
|
|
|
} /* namespace scheduling */
|
|
} /* namespace wfr */
|
|
|