public code v1
This commit is contained in:
+65
@@ -0,0 +1,65 @@
|
||||
package flintstones.valuation.fuzzy;
|
||||
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.XMLStreamWriter;
|
||||
import flintstones.domain.fuzzyset.function.types.TrapezoidalFunction;
|
||||
import flintstones.entity.domain.Domain;
|
||||
import flintstones.entity.valuation.Valuation;
|
||||
import flintstones.helper.data.wxml.WNode;
|
||||
|
||||
public class FuzzyValuation extends Valuation {
|
||||
|
||||
public static final String ID = "flintstones.valuation.fuzzy"; //$NON-NLS-1$
|
||||
|
||||
private TrapezoidalFunction fuzzyNumber;
|
||||
|
||||
public FuzzyValuation() {
|
||||
super();
|
||||
|
||||
this.setId(FuzzyValuation.ID);
|
||||
this.domain = null;
|
||||
this.fuzzyNumber = null;
|
||||
}
|
||||
|
||||
public FuzzyValuation(TrapezoidalFunction fuzzyNumber, Domain domain) {
|
||||
super();
|
||||
|
||||
this.setId(FuzzyValuation.ID);
|
||||
this.domain = domain;
|
||||
this.fuzzyNumber = fuzzyNumber;
|
||||
}
|
||||
|
||||
public TrapezoidalFunction getFuzzyNumber() {
|
||||
return fuzzyNumber;
|
||||
}
|
||||
|
||||
public void setFuzzyNumber(TrapezoidalFunction fuzzyNumber) {
|
||||
this.fuzzyNumber = fuzzyNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Valuation o) {
|
||||
TrapezoidalFunction otherFuzzyNumber = ((FuzzyValuation) o).getFuzzyNumber();
|
||||
return fuzzyNumber.compareTo(otherFuzzyNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initFromString(String value) {}
|
||||
|
||||
@Override
|
||||
public Valuation negateValuation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String changeFormatValuationToString() {
|
||||
return this.fuzzyNumber.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(XMLStreamWriter writer) throws XMLStreamException {}
|
||||
|
||||
@Override
|
||||
public void read(WNode node) {}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user