public DefaultReconfigurationProblem build ( ) throws SchedulerException { if ( runs == null ) { //The others are supposed to be null too as they are set using the same method Mapping map = model . getMapping ( ) ; runs = new HashSet <> ( ) ; sleep = new HashSet <> ( ) ; for ( Node n : map . getOnlineNodes ( ) ) { runs . addAll ( map . getRunningVMs ( n ) ) ; sleep . addAll ( map . getSleepingVMs ( n ) ) ; } waits = map . getReadyVMs ( ) ; over = Collections . emptySet ( ) ; } if ( manageable == null ) { manageable = new HashSet <> ( ) ; manageable . addAll ( model . getMapping ( ) . getSleepingVMs ( ) ) ; manageable . addAll ( model . getMapping ( ) . getRunningVMs ( ) ) ; manageable . addAll ( model . getMapping ( ) . getReadyVMs ( ) ) ; } if ( ps == null ) { ps = new DefaultParameters ( ) ; } return new DefaultReconfigurationProblem ( model , ps , waits , runs , sleep , over , manageable ) ; }
Build the problem