|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.xmcda_oo.services.utils.AssignmentsPerturber
public class AssignmentsPerturber
Perturbs assignments. Perturbing an assignment (of an alternative A into a category C1) is transforming it into an assignment of A into a category C2 such that C1 is different than C2.
Requires the possibility of having a superset of categories compared to those where alternatives are indeed assigned.
| Constructor Summary | |
|---|---|
AssignmentsPerturber()
|
|
| Method Summary | |
|---|---|
void |
bindTo(IOrderedAssignments assignments)
|
double |
getProportionPerturbation()
|
void |
perturb()
Assignments must be bound, the proportion of perturbation must be set. |
void |
setProportionPerturbation(double propPerturb)
Sets the proportion of assignments to be perturbed. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AssignmentsPerturber()
| Method Detail |
|---|
public void bindTo(IOrderedAssignments assignments)
assignments - null to unbind.
public void perturb()
throws InvalidInputException
Assignments must be bound, the proportion of perturbation must be set.
Perturbs the assignments this object is bound to. The bound assignments are perturbed according to the proportion previously set. The perturbation is done in place. Only if the proportion is zero or rounds to zero will the assignments be unchanged.
InvalidInputException - Perturbing assignments having only one category is impossible, in that case and if the proportion to
be perturbed leads to perturb at least one assignment (thus does not round to zero), an error is
raised. Exception also raised if the bound assignments are multi-categories and at least one
assignment must be perturbed: perturbation of multi-categories assignments is not defined.public void setProportionPerturbation(double propPerturb)
propPerturb - a number between zero and one, or a negative number for not set. If zero, perturb will do nothing. If
one, every assignments will be perturbed.public double getProportionPerturbation()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||