list of assessments #85

Merged
romanov73 merged 6 commits from 84-list-of-consequents into master 2023-02-02 13:05:28 +04:00
5 changed files with 39 additions and 8 deletions
Showing only changes of commit f76976899d - Show all commits

View File

@ -19,7 +19,7 @@ public class Route {
public static final String STATISTIC = "statistic";
public static final String LIST_RULE = "listRules";
public static final String ADD_RULE = "addRule";
public static final String RECOMMENDATIONS = "recommendations";
public static final String ASSESSMENTS = "assessments";
public static final String DELETE_RULE = "deleteRule";
public static String getLIST_INDEXED_REPOSITORIES() {
@ -42,7 +42,7 @@ public class Route {
return STATISTIC;
}
public static String getRECOMMENDATIONS() {
return RECOMMENDATIONS;
public static String getASSESSMENTS() {
return ASSESSMENTS;
}
}

View File

@ -11,7 +11,7 @@ import springfox.documentation.annotations.ApiIgnore;
import java.util.Optional;
import static ru.ulstu.extractor.core.Route.RECOMMENDATIONS;
import static ru.ulstu.extractor.core.Route.ASSESSMENTS;
@Controller
@ApiIgnore
@ -25,15 +25,15 @@ public class RecommendationController {
this.branchService = branchService;
}
@GetMapping(RECOMMENDATIONS)
@GetMapping(ASSESSMENTS)
public String getRecommendations(Model model, @RequestParam Optional<Integer> branchId) {
model.addAttribute("branches", branchService.findAll());
if (branchId.isPresent()) {
model.addAttribute("recommendations", fuzzyInferenceService.getRecommendations(branchId.get()));
model.addAttribute("assessments", fuzzyInferenceService.getAssessments(branchId.get()));
model.addAttribute("filterBranchForm", new FilterBranchForm(branchId.get()));
} else {
model.addAttribute("filterBranchForm", new FilterBranchForm());
}
return RECOMMENDATIONS;
return ASSESSMENTS;
}
}

View File

@ -0,0 +1,31 @@
package ru.ulstu.extractor.recommendation.model;
import ru.ulstu.extractor.ts.model.TimeSeriesType;
public class Assessment {
private String consequent;
private TimeSeriesType firstAntecedent;
private String firstAntecedentTendency;
private TimeSeriesType secondAntecedent;
private String secondAntecedentTendency;
public String getConsequent() {
return consequent;
}
public TimeSeriesType getFirstAntecedent() {
return firstAntecedent;
}
public String getFirstAntecedentTendency() {
return firstAntecedentTendency;
}
public TimeSeriesType getSecondAntecedent() {
return secondAntecedent;
}
public String getSecondAntecedentTendency() {
return secondAntecedentTendency;
}
}

View File

@ -109,7 +109,7 @@ public class FuzzyInferenceService {
return engine;
}
public String getRecommendations(Integer branchId) {
public String getAssessments(Integer branchId) {
List<TimeSeries> timeSeries = timeSeriesService.getByBranch(branchId);
Engine engine = getFuzzyEngine();
List<AntecedentValue> antecedentValues = antecedentValueService.getList();