Merged in differentSwitchingMechanisms (pull request #14)
DifferentSwitchingMechanisms Approved-by: Akash Kothawale <akothaw1@binghamton.edu>
This commit is contained in:
parent
1bee742588
commit
66c19b53c9
13 changed files with 172 additions and 31 deletions
|
@ -117,9 +117,14 @@ func WithLoggingChannels(lmt chan elecLogDef.LogMessageType, msg chan string) sc
|
|||
}
|
||||
}
|
||||
|
||||
func WithSchedPolSwitchEnabled(enableSchedPolicySwitch bool) schedulerOptions {
|
||||
func WithSchedPolSwitchEnabled(enableSchedPolicySwitch bool, switchingCriteria string) schedulerOptions {
|
||||
return func(s ElectronScheduler) error {
|
||||
s.(*BaseScheduler).schedPolSwitchEnabled = enableSchedPolicySwitch
|
||||
// Checking if valid switching criteria.
|
||||
if _, ok := switchBasedOn[switchingCriteria]; !ok {
|
||||
return errors.New("Invalid scheduling policy switching criteria.")
|
||||
}
|
||||
s.(*BaseScheduler).schedPolSwitchCriteria = switchingCriteria
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue