bodyS = new double[data.numAttributes() - 1][2];
double k = 2 * Math.PI / (data.numAttributes() - 1);
// Add DataDictionary
Enumeration enumerAttributes = data.enumerateAttributes();
while (enumerAttributes.hasMoreElements()) {
Attribute attr = (Attribute) enumerAttributes.nextElement();
DataFieldType dataField = _40Factory.eINSTANCE
.createDataFieldType();
dataField.setDataType(DATATYPE.DOUBLE); // DATATYPE
dataField.setName(attr.name()); // String
dataField.setOptype(OPTYPE.CONTINUOUS); // OPTYPE
String[] strCoordinates = null;
strCoordinates = createAnchors(attr.index(), k);
// Add Extension - Coordinate X
ExtensionType extension = _40Factory.eINSTANCE
.createExtensionType();
extension.setName("xCoordinate");
extension.setValue(strCoordinates[0]);
dataField.getExtension().add(extension);
// Add Extension - Coordinate y
extension = _40Factory.eINSTANCE.createExtensionType();
extension.setName("yCoordinate");
extension.setValue(strCoordinates[1]);
dataField.getExtension().add(extension);
dataDictionary.getDataField().add(dataField);
}
DataFieldType dataField = _40Factory.eINSTANCE.createDataFieldType();
dataField.setDataType(DATATYPE.STRING); // DATATYPE
dataField.setName("class"); // String
dataField.setOptype(OPTYPE.CATEGORICAL); // OPTYPE
dataDictionary.getDataField().add(dataField);
Attribute classAttr = data.classAttribute();
Enumeration values = classAttr.enumerateValues();
while (values.hasMoreElements()) {
ValueType valueType = _40Factory.eINSTANCE.createValueType();
valueType.setValue(values.nextElement().toString());
dataField.getValue().add(valueType);