Commit 5e1c5c78 authored by lafabregue's avatar lafabregue

update constraint format to Orlean format and add distance matrix computation

parent c2ceff50
......@@ -9,9 +9,9 @@ package jcl.clustering.constraints;
public abstract class Constraint {
/** All the types of possible constraints */
static final public int LABEL_TYPE = 1;
static final public int MUST_LINK_TYPE = 2;
static final public int CANNOT_LINK_TYPE = 3;
static final public int LABEL_TYPE = 2;
static final public int MUST_LINK_TYPE = 1;
static final public int CANNOT_LINK_TYPE = -1;
static final public int NB_CLUSTER_TYPE = 101;
static final public int CLUSTER_DIAMETER_TYPE = 102;
......@@ -20,8 +20,8 @@ public abstract class Constraint {
/**
* Retrieve the sting representation of the constraints.
* This method is used for export purpose, so it should respect the following pattern :
* <type id of constraints>;<index(es) of concerned elements>;<other properties>
* This method is used for export/import purpose, so it should respect the following pattern :
* <index(es) of concerned elements>;<other properties>;<type id of constraints>
*/
@Override
public abstract String toString();
......
......@@ -9,7 +9,14 @@ import java.util.Vector;
import jcl.clustering.ClusteringResult;
import jcl.clustering.constraints.Constraint;
import jcl.data.attribute.Attribute;
import jcl.data.attribute.AttributeDCMDSequence;
import jcl.data.attribute.AttributeDSCMDSequence;
import jcl.data.attribute.AttributeHardConstrainedMultiDimSequence;
import jcl.data.attribute.AttributeMDMRHSequence;
import jcl.data.attribute.AttributeMDMRSequence;
import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.data.attribute.AttributeSequence;
import jcl.data.attribute.AttributeSymbolicSequence;
import jcl.data.mask.Mask;
import jcl.data.sampling.Sampler;
import jcl.utils.Histogram;
......@@ -761,7 +768,14 @@ public abstract class Data implements Cloneable, Serializable, Iterable<DataObje
*/
public boolean isSequence() {
if (getOneDataObject().getNbAttributes() > 0 &&
getOneDataObject().getAttribute(0) instanceof AttributeSequence)
(getOneDataObject().getAttribute(0) instanceof AttributeSequence ||
getOneDataObject().getAttribute(0) instanceof AttributeDCMDSequence ||
getOneDataObject().getAttribute(0) instanceof AttributeDSCMDSequence ||
getOneDataObject().getAttribute(0) instanceof AttributeMultiDimSequence ||
getOneDataObject().getAttribute(0) instanceof AttributeHardConstrainedMultiDimSequence ||
getOneDataObject().getAttribute(0) instanceof AttributeMDMRHSequence ||
getOneDataObject().getAttribute(0) instanceof AttributeMDMRSequence ||
getOneDataObject().getAttribute(0) instanceof AttributeSymbolicSequence))
return true;
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment