mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-22 07:02:29 +00:00
couple of final neatenings up of CTD
This commit is contained in:
parent
de809b6572
commit
682715018f
@ -36,7 +36,7 @@ public class CTClassifierParams implements Cloneable, Serializable, ManagedParam
|
|||||||
/**
|
/**
|
||||||
* A unique ID for the classifier that never changes. This is important for accessing data selectors.
|
* A unique ID for the classifier that never changes. This is important for accessing data selectors.
|
||||||
*/
|
*/
|
||||||
public String uniqueID = UUID.randomUUID().toString();
|
private String uniqueID = UUID.randomUUID().toString();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -72,4 +72,21 @@ public class CTClassifierParams implements Cloneable, Serializable, ManagedParam
|
|||||||
return ps;
|
return ps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the uniqueID
|
||||||
|
*/
|
||||||
|
public String getUniqueID() {
|
||||||
|
if (uniqueID == null) {
|
||||||
|
uniqueID = UUID.randomUUID().toString();
|
||||||
|
}
|
||||||
|
return uniqueID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param uniqueID the uniqueID to set
|
||||||
|
*/
|
||||||
|
public void setUniqueID(String uniqueID) {
|
||||||
|
this.uniqueID = uniqueID;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -119,14 +119,13 @@ public class Chi2ThresholdClassifier implements CTClassifier {
|
|||||||
public void createDataSelector(PamDataBlock<?> source) {
|
public void createDataSelector(PamDataBlock<?> source) {
|
||||||
//System.out.println("Create data selector " +" " + clssfrParams.classifierName + " " + clssfrParams.speciesFlag + " " + clssfrParams.uniqueID );
|
//System.out.println("Create data selector " +" " + clssfrParams.classifierName + " " + clssfrParams.speciesFlag + " " + clssfrParams.uniqueID );
|
||||||
|
|
||||||
if (clssfrParams.uniqueID==null) clssfrParams.newUniqueID();
|
|
||||||
|
|
||||||
if (dataSelector==null || dataSelector.getPamDataBlock()!=source) {
|
if (dataSelector==null || dataSelector.getPamDataBlock()!=source) {
|
||||||
//create the data selector
|
//create the data selector
|
||||||
//System.out.println("Data selector: " + dataSelector);
|
//System.out.println("Data selector: " + dataSelector);
|
||||||
if (source!=null) {
|
if (source!=null) {
|
||||||
|
|
||||||
dataSelector=source.getDataSelectCreator().getDataSelector(clickTrainControl.getUnitName() + "_" + clssfrParams.uniqueID
|
dataSelector=source.getDataSelectCreator().getDataSelector(clickTrainControl.getUnitName() + "_" + clssfrParams.getUniqueID()
|
||||||
+ "_X2_threshold_classifier", false, null);
|
+ "_X2_threshold_classifier", false, null);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -132,6 +132,10 @@ public class CTDataSelector extends DataSelector {
|
|||||||
|
|
||||||
if (clickTrain.ctClassifications==null) return false;
|
if (clickTrain.ctClassifications==null) return false;
|
||||||
|
|
||||||
|
if (ctSelectParams.classifier == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int nClass = clickTrain.ctClassifications.size();
|
int nClass = clickTrain.ctClassifications.size();
|
||||||
if (ctSelectParams.allowMultipleChoices == false) {
|
if (ctSelectParams.allowMultipleChoices == false) {
|
||||||
int clsInd = clickTrain.getClassificationIndex();
|
int clsInd = clickTrain.getClassificationIndex();
|
||||||
|
@ -229,7 +229,7 @@ public class SimpleCTClassifierPane extends SettingsPane<Chi2ThresholdParams> {
|
|||||||
simpleChi2Classifier.getDataSelector().getDialogPaneFX().getParams(true);
|
simpleChi2Classifier.getDataSelector().getDialogPaneFX().getParams(true);
|
||||||
}
|
}
|
||||||
if (this.currParams != null) {
|
if (this.currParams != null) {
|
||||||
currParams.uniqueID = this.currParams.uniqueID;
|
currParams.setUniqueID(this.currParams.getUniqueID());
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.currParams=currParams;
|
return this.currParams=currParams;
|
||||||
|
Loading…
Reference in New Issue
Block a user