package Ġcom . github . ker ub istan . ker ub . planner . steps . host . startup Ċ Ċ import Ġcom . github . ker ub istan . ker ub . model . Host Ċ import Ġcom . github . ker ub istan . ker ub . model . dynamic . Host Dynamic Ċ import Ġcom . github . ker ub istan . ker ub . model . dynamic . Host Status Ċ import Ġcom . github . ker ub istan . ker ub . planner . Operation al State Ċ import Ġcom . github . ker ub istan . ker ub . planner . costs . Cost Ċ import Ġcom . github . ker ub istan . ker ub . planner . costs . Time Cost Ċ import Ġcom . github . ker ub istan . ker ub . planner . re servations . Full Host Reservation Ċ import Ġcom . github . ker ub istan . ker ub . planner . re servations . Reservation Ċ import Ġcom . github . ker ub istan . ker ub . planner . steps . Abstract Operation al Step Ċ import Ġio . github . ker ub istan . k ro ki . collections . update Ċ import Ġjava . math . BigInteger Ċ Ċ abstract Ġclass ĠAbstract Wake Host Ġ: ĠAbstract Operation al Step Ġ{ Ċ ĉ abstract Ġval Ġhost : ĠHost ĊĊ ĉ override Ġfun Ġre servations (): ĠList < Reservation < Host >> Ġ= ĠlistOf ( Full Host Reservation ( host )) ĊĊ ĉ override Ġfun Ġtake ( state : ĠOperation al State ): ĠOperation al State Ġ{ Ċĉ ĉ val Ġdyn Ġ= ĠHost Dynamic ( Ċĉĉĉ ĉ id Ġ= Ġhost . id , Ċĉĉĉ ĉ status Ġ= ĠHost Status . Up , Ċĉĉĉ ĉ mem Free Ġ= Ġhost . capabilities ?. total Memory , Ċĉĉĉ ĉ mem Used Ġ= ĠBigInteger . ZERO , Ċĉĉĉ ĉ user Cpu Ġ= Ġ 0 , Ċĉĉĉ ĉ system Cpu Ġ= Ġ 0 Ċĉ ĉ ) ĊĊĉ ĉ return Ġstate . copy ( Ċĉĉĉ ĉ hosts Ġ= Ġstate . hosts . update ( host . id ) Ġ{ Ċĉĉĉĉ ĉ it . copy ( Ċĉĉĉĉĉĉ ĉ dynamic Ġ= Ġdyn Ċĉĉĉĉ ĉ ) Ċĉĉĉ ĉ } Ċĉ ĉ ) Ċ ĉ } ĊĊ ĉ /* Ċĉ Ġ* ĠTODO Ġ- Ġissue Ġ# 1 2 6 Ċĉ Ġ* ĠCost Ġcalculation Ġhere Ġignores Ġfacts Ġand Ġbuilds Ġon Ġhardcoded Ġdefaults Ċĉ Ġ* ĠWhat Ġshould Ġbe Ġhere Ġin Ġthe Ġfuture : Ċĉ Ġ* Ġ- Ġdecision Ġbased Ġon Ġthe Ġpower Ġmanagement - method Ċĉ Ġ* Ġ( e . g . ĠWo L Ġcould Ġbe Ġcounted Ġas Ġa Ġrisk ) Ċĉ Ġ* Ġ- ĠEst imation Ġbased Ġon Ġprevious Ġsuch Ġoperations Ċĉ Ġ*/ Ċ ĉ override Ġfun Ġget Cost (): ĠList < Cost > Ġ{ Ċĉ ĉ return ĠlistOf ( Ċĉĉĉ ĉ Time Cost ( Ċĉĉĉĉĉ ĉ min Ms Ġ= Ġ 1 0 0 0 0 , Ċĉĉĉĉĉ ĉ max Ms Ġ= Ġ 1 0 0 0 0 0 0 Ċĉĉĉ ĉ ) Ċĉ ĉ ) Ċ ĉ } Ċ }