public static boolean createWire ( final DistributionPattern pattern , final int nodeLowerStage , final int nodeUpperStage , final int sizeSetLowerStage , final int sizeSetUpperStage ) { switch ( pattern ) { case BIPARTITE : return true ; case POINTWISE : if ( sizeSetLowerStage < sizeSetUpperStage ) { if ( nodeLowerStage == ( nodeUpperStage % sizeSetLowerStage ) ) { return true ; } } else { if ( ( nodeLowerStage % sizeSetUpperStage ) == nodeUpperStage ) { return true ; } } return false ; /* * case STAR: * if (sizeSetLowerStage > sizeSetUpperStage) { * int groupNumber = nodeLowerStage / Math.max(sizeSetLowerStage / sizeSetUpperStage, 1); * if (nodeUpperStage == groupNumber) { * return true; * } * } else { * int groupNumber = nodeUpperStage / Math.max(sizeSetUpperStage / sizeSetLowerStage, 1); * if (nodeLowerStage == groupNumber) { * return true; * } * } * return false; */ default : // this will never happen. throw new IllegalStateException ( "No Match for Distribution Pattern found." ) ; } }
Checks if two subtasks of different tasks should be wired .