if (cascadeStage != -1 && conceptBinType.equals("") && conceptBinParams.equals("")) {
cascade_stage_proper = cascade_stage;
}
// Construct the clique set.
CascadeCliqueSet cliqueSet = (CascadeCliqueSet) (CascadeCliqueSet.create(cliqueSetType,
env, queryTerms, child, cascade_stage_proper, pruner_and_params));// , approxProximity);
// Get cliques from clique set.
List<Clique> cliques = cliqueSet.getCliques();
if (cascadeStage != -1 && conceptBinType.equals("") && conceptBinParams.equals("")) {
if (cliques.size() > 0) {
cascade_stage++;
}
} else if (cascadeStage != -1 && !conceptBinType.equals("") && !conceptBinParams.equals("")) {
if (cliques.size() > 0) {
int[] order = new int[cliques.size()];
double[] conceptWeights = new double[cliques.size()];
int cntr = 0;
String all_concepts = "";
for (Clique c : cliques) {
float importance = importanceModel.getCliqueWeight(c);
order[cntr] = cntr;
conceptWeights[cntr] = importance;
cntr++;
all_concepts += c.getConcept() + " ";
}
ivory.smrf.model.constrained.ConstraintModel.Quicksort(conceptWeights, order, 0,
order.length - 1);
int[] keptCliques = getCascadeCliques(conceptBinType, conceptBinParams, conceptWeights,
order, all_concepts, featureID, thePruner, width + "", scoreFunction);
List<Clique> cliques2 = Lists.newArrayList();
for (int k = 0; k < keptCliques.length; k++) {
int index = keptCliques[k];
cliques2.add(cliques.get(index));
}
cliques = Lists.newArrayList();
for (int k = 0; k < cliques2.size(); k++) {
cliques.add(cliques2.get(k));
}
if (keptCliques.length != 0) {
for (Clique c : cliques) {
((CascadeClique) c).setCascadeStage(cascade_stage);
}
cascade_stage++;
}
}
}
for (Clique c : cliques) {
double w = weight;
c.setParameterName(featureID); // Parameter id.
c.setParameterWeight(weight); // Weight.
c.setType(cliqueSet.getType()); // Clique type.
// Get clique weight.
if (!importanceSource.equals("")) {
float importance = importanceModel.getCliqueWeight(c);