Skip to content

Commit

Permalink
Disable processExactMatch functionality
Browse files Browse the repository at this point in the history
1. This approach allowed rapid analysis at 100% similarity.
2. Disabled due to the great complexity of the new functionalities
3. Temporary
  • Loading branch information
tchrapovic committed Mar 15, 2024
1 parent f478117 commit 6abe5ec
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ public List<PrismObject<RoleAnalysisClusterType>> executeClustering(
double similarityThreshold = sessionOptionType.getSimilarityThreshold();
double similarityDifference = 1 - (similarityThreshold / 100);

if (similarityDifference == 0.00) {
return new RoleAnalysisAlgorithmUtils().processExactMatch(
roleAnalysisService, dataPoints, session, handler, task, result);
}
// if (similarityDifference == 0.00) {
// return new RoleAnalysisAlgorithmUtils().processExactMatch(
// roleAnalysisService, dataPoints, session, handler, task, result);
// }

int minUsersOverlap = sessionOptionType.getMinPropertiesOverlap();
int minRolesCount = sessionOptionType.getMinMembersCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ public List<PrismObject<RoleAnalysisClusterType>> executeClustering(
double similarityThreshold = sessionOptionType.getSimilarityThreshold();
double similarityDifference = 1 - (similarityThreshold / 100);

if (similarityDifference == 0.00) {
return new RoleAnalysisAlgorithmUtils().processExactMatch(roleAnalysisService, dataPoints, session,
handler, task, result);
}
// if (similarityDifference == 0.00) {
// return new RoleAnalysisAlgorithmUtils().processExactMatch(roleAnalysisService, dataPoints, session,
// handler, task, result);
// }

int minRolesOverlap = sessionOptionType.getMinPropertiesOverlap();
int minUsersCount = sessionOptionType.getMinMembersCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,38 +75,42 @@ public List<RoleAnalysisDetectionPatternType> loadPattern(
List<RoleAnalysisDetectionPatternType> roleAnalysisClusterDetectionTypeList = new ArrayList<>();
AbstractAnalysisSessionOptionType sessionOption = getSessionOptionType(session);

if (sessionOption.getSimilarityThreshold() == 100) {

RoleAnalysisDetectionPatternType roleAnalysisClusterDetectionType = new RoleAnalysisDetectionPatternType();

Set<ObjectReferenceType> roles;
Set<ObjectReferenceType> users;

if (roleAnalysisProcessModeType.equals(RoleAnalysisProcessModeType.ROLE)) {
users = clusterStatistic.getPropertiesRef();
roles = clusterStatistic.getMembersRef();
} else {
roles = clusterStatistic.getPropertiesRef();
users = clusterStatistic.getMembersRef();
}

List<ObjectReferenceType> rolesOccupancy = roleAnalysisClusterDetectionType.getRolesOccupancy();
roles.stream().map(ObjectReferenceType::clone).forEach(rolesOccupancy::add);

List<ObjectReferenceType> userOccupancy = roleAnalysisClusterDetectionType.getUserOccupancy();
users.stream().map(ObjectReferenceType::clone).forEach(userOccupancy::add);

int propertiesCount = roles.size();
int membersCount = users.size();

roleAnalysisClusterDetectionType.setClusterMetric((double) propertiesCount * membersCount);
roleAnalysisClusterDetectionTypeList.add(roleAnalysisClusterDetectionType.clone());
} else {
List<RoleAnalysisDetectionPatternType> clusterDetectionTypeList = resolveDefaultIntersection(session,
clusterType, result, task);
roleAnalysisClusterDetectionTypeList.addAll(clusterDetectionTypeList);

}
// if (sessionOption.getSimilarityThreshold() == 100) {
//
// RoleAnalysisDetectionPatternType roleAnalysisClusterDetectionType = new RoleAnalysisDetectionPatternType();
//
// Set<ObjectReferenceType> roles;
// Set<ObjectReferenceType> users;
//
// if (roleAnalysisProcessModeType.equals(RoleAnalysisProcessModeType.ROLE)) {
// users = clusterStatistic.getPropertiesRef();
// roles = clusterStatistic.getMembersRef();
// } else {
// roles = clusterStatistic.getPropertiesRef();
// users = clusterStatistic.getMembersRef();
// }
//
// List<ObjectReferenceType> rolesOccupancy = roleAnalysisClusterDetectionType.getRolesOccupancy();
// roles.stream().map(ObjectReferenceType::clone).forEach(rolesOccupancy::add);
//
// List<ObjectReferenceType> userOccupancy = roleAnalysisClusterDetectionType.getUserOccupancy();
// users.stream().map(ObjectReferenceType::clone).forEach(userOccupancy::add);
//
// int propertiesCount = roles.size();
// int membersCount = users.size();
//
// roleAnalysisClusterDetectionType.setClusterMetric((double) propertiesCount * membersCount);
// roleAnalysisClusterDetectionTypeList.add(roleAnalysisClusterDetectionType.clone());
// } else {
// List<RoleAnalysisDetectionPatternType> clusterDetectionTypeList = resolveDefaultIntersection(session,
// clusterType, result, task);
// roleAnalysisClusterDetectionTypeList.addAll(clusterDetectionTypeList);
//
// }

List<RoleAnalysisDetectionPatternType> clusterDetectionTypeList = resolveDefaultIntersection(session,
clusterType, result, task);
roleAnalysisClusterDetectionTypeList.addAll(clusterDetectionTypeList);

return roleAnalysisClusterDetectionTypeList;
}
Expand Down

0 comments on commit 6abe5ec

Please sign in to comment.