Skip to content

Commit

Permalink
Merge pull request #135 from yjx0003/133-clustering-display-error-sel…
Browse files Browse the repository at this point in the history
…ecting-only-2-elements-or-less

Fix bug #133
  • Loading branch information
rmartico authored Jul 18, 2024
2 parents b55c92e + e1bbe22 commit 7dfba2d
Showing 1 changed file with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ public class PartitionalClusteringController {

@FXML
private ProgressIndicator progressExecute;

@FXML
private DatePicker datePickerStart;

@FXML
private DatePicker datePickerEnd;

Expand Down Expand Up @@ -221,17 +221,17 @@ private void initCollectors() {
gradesCollector = new GradesCollector(mainController);
activityCollector = new ActivityCollector(mainController);
List<LogCollector<?>> list = new ArrayList<>();
list.add(new LogCollector<>("component", mainController.getSelectionController().getListViewComponents(), DataSetComponent.getInstance(),
t -> t.name().toLowerCase()));
list.add(new LogCollector<>("event", mainController.getSelectionController().getListViewEvents(), DataSetComponentEvent.getInstance(),
t -> t.getComponent().name().toLowerCase()));
list.add(new LogCollector<>("section", mainController.getSelectionController().getListViewSection(), DataSetSection.getInstance(),
t -> t.isVisible() ? "visible" : "not_visible"));
list.add(new LogCollector<>("component", mainController.getSelectionController().getListViewComponents(),
DataSetComponent.getInstance(), t -> t.name().toLowerCase()));
list.add(new LogCollector<>("event", mainController.getSelectionController().getListViewEvents(),
DataSetComponentEvent.getInstance(), t -> t.getComponent().name().toLowerCase()));
list.add(new LogCollector<>("section", mainController.getSelectionController().getListViewSection(),
DataSetSection.getInstance(), t -> t.isVisible() ? "visible" : "not_visible"));
list.add(new LogCollector<>("coursemodule", mainController.getSelectionController().getListViewCourseModule(),
DatasSetCourseModule.getInstance(), t -> t.getModuleType().getModName()));
checkComboBoxLogs.getItems().setAll(list);
checkComboBoxLogs.getCheckModel().checkAll();

JavaFXUtils.initDatePickers(datePickerStart, datePickerEnd, checkBoxLogs);
}

Expand All @@ -244,8 +244,8 @@ protected Task<Void> createTask() {

@Override
protected Void call() throws Exception {
List<EnrolledUser> users = mainController.getSelectionUserController().getListParticipants().getSelectionModel()
.getSelectedItems();
List<EnrolledUser> users = mainController.getSelectionUserController().getListParticipants()
.getSelectionModel().getSelectedItems();
Algorithm algorithm = algorithmList.getSelectionModel().getSelectedItem();

List<DataCollector> collectors = getSelectedCollectors();
Expand All @@ -268,12 +268,17 @@ protected Void call() throws Exception {
buttonExecute.disableProperty().bind(service.runningProperty());
progressExecute.visibleProperty().bind(service.runningProperty());
service.setOnSucceeded(e -> {
silhouette.updateChart(clusters);
clusteringTableController.updateTable(clusters);
updateRename();
graph.updateChart(clusters);
graph3D.updateChart(clusters);
service.reset();
try { // #133 RMS FIXME temporal solution but the data validation should be improved...
silhouette.updateChart(clusters);
clusteringTableController.updateTable(clusters);
updateRename();
graph.updateChart(clusters);
graph3D.updateChart(clusters);
service.reset(); // set an stable state
} catch (Exception exception) { // when is not possible to draw some chart by the number of features...
service.reset(); // RMS should be really in a finally clause avoiding duplication...
LOGGER.error("Exception updating charts in clustering, review validation data: {}", exception);
}
});
service.setOnFailed(e -> {
Throwable exception = service.getException();
Expand Down Expand Up @@ -320,7 +325,8 @@ public void executeAnalysis() {
int start = (int) rangeSlider.getLowValue();
int end = (int) rangeSlider.getHighValue();

List<EnrolledUser> users = mainController.getSelectionUserController().getListParticipants().getSelectionModel().getSelectedItems();
List<EnrolledUser> users = mainController.getSelectionUserController().getListParticipants().getSelectionModel()
.getSelectedItems();
List<DataCollector> collectors = getSelectedCollectors();
AnalysisMethod analysisMethod = choiceBoxAnalyze.getValue().createAnalysis(algorithm);

Expand Down

0 comments on commit 7dfba2d

Please sign in to comment.