Skip to content

Commit

Permalink
Links created parameter added to genetic search.
Browse files Browse the repository at this point in the history
  • Loading branch information
Smoren committed Dec 28, 2024
1 parent cde4a66 commit 0712f30
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data/input/default-clusterization-weights.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"radiusWeight": 1,
"speedWeight": 0.5,
"relativeCompoundedAtomsCountWeight": 1,
"relativeLinksCountWeight": 1
"relativeLinksCountWeight": 1,
"linksCreatedWeight": 1
}
2 changes: 2 additions & 0 deletions src/lib/analysis/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export function createDefaultClusterizationWeightsConfig(): ClusterizationWeight
speedWeight: 0.5,
relativeCompoundedAtomsCountWeight: 1,
relativeLinksCountWeight: 1,
linksCreatedWeight: 1,
};
}

Expand All @@ -205,5 +206,6 @@ export function createModifiedClusterizationWeightsConfig(): ClusterizationWeigh
speedWeight: 0.5,
relativeCompoundedAtomsCountWeight: 1,
relativeLinksCountWeight: 1,
linksCreatedWeight: 1,
};
}
2 changes: 2 additions & 0 deletions src/lib/genetic/grade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export async function runSimulationForClustersGrade(
);
const clustersMetrics = calcMetricsForCompoundClustersSummary(clustersSummary, weights);
const [clustersScore, clusterSize, clustersCount, relativeClustered, relativeFiltered] = clustersMetrics;
const linksCreated = sim.summary.LINKS_CREATED[0];
const rawMatrix = [
clustersScore,
clusterSize ** weights.clusterSizeWeight,
Expand All @@ -86,6 +87,7 @@ export async function runSimulationForClustersGrade(
relativeFiltered ** weights.relativeFilteredCountWeight,
relativeCompoundedAtomsCount ** weights.relativeCompoundedAtomsCountWeight,
relativeLinksCount ** weights.relativeLinksCountWeight,
linksCreated ** weights.linksCreatedWeight,
];
summaryMatrix.push(rawMatrix);

Expand Down
1 change: 1 addition & 0 deletions src/lib/genetic/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ export type ClusterizationWeightsConfig = {
speedWeight: number;
relativeCompoundedAtomsCountWeight: number;
relativeLinksCountWeight: number;
linksCreatedWeight: number;
}

0 comments on commit 0712f30

Please sign in to comment.