public List < Map < String , String > > pipelinePossibleStates ( NWiseAction action , List < Map < String , String > > possibleStateList ) { String [ ] coVariables = action . getCoVariables ( ) . split ( "," ) ; int n = Integer . valueOf ( action . getN ( ) ) ; List < Map < String , String > > newPossibleStateList = new ArrayList <> ( ) ; for ( Map < String , String > possibleState : possibleStateList ) { Map < String , String [ ] > variableDomains = new HashMap <> ( ) ; Map < String , String > defaultVariableValues = new HashMap <> ( ) ; for ( String variable : coVariables ) { String variableMetaInfo = possibleState . get ( variable ) ; String [ ] variableDomain = variableMetaInfo . split ( "," ) ; variableDomains . put ( variable , variableDomain ) ; defaultVariableValues . put ( variable , variableDomain [ 0 ] ) ; } List < Map < String , String > > nWiseCombinations = produceNWise ( n , coVariables , variableDomains ) ; for ( Map < String , String > nWiseCombination : nWiseCombinations ) { Map < String , String > newPossibleState = new HashMap <> ( possibleState ) ; newPossibleState . putAll ( defaultVariableValues ) ; newPossibleState . putAll ( nWiseCombination ) ; newPossibleStateList . add ( newPossibleState ) ; } } return newPossibleStateList ; }
Uses current variable assignments and info in an NWiseActionTag to expand on an n wise combinatorial set