private IntVar getVMtoLeafNode ( ) { for ( int x = 0 ; x < outs . length ; x ++ ) { if ( outs [ x ] . cardinality ( ) == 0 ) { //no outgoing VMs, can be launched directly. BitSet in = ins [ x ] ; for ( int i = in . nextSetBit ( 0 ) ; i >= 0 ; i = in . nextSetBit ( i + 1 ) ) { if ( starts [ i ] != null && ! starts [ i ] . isInstantiated ( ) ) { return starts [ i ] ; } } } } return null ; }
Get the start moment for a VM that move to a node where no VM will leave this node . This way we are pretty sure the action can be scheduled at 0 .