Skip to content

Commit

Permalink
Clusterization algorithm can now be configured
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeychernyshev committed Aug 20, 2024
1 parent 15d4e0b commit 1e414ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/gameConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import fs from "fs";
import { pathToFileURL } from "url";

import novaTerraPrime from "./tiles/novaTerraPrime.js";
import clusterize from "./clusterize.js";

export const defaultGameConfig = {
tileSet: novaTerraPrime,
minTiles: 10,
timelapseLookBackPerfRun: 20,
createTimelapse: false,
clusterize,
};

export const getGameConfig = async (...filenames) => {
Expand Down
2 changes: 1 addition & 1 deletion src/getClusters.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async function getClusters(repo, gameConfig) {
* Deterministicly group files into clusters for each city block
*/
const files = repo.map((elem) => elem.Files).flat();
const clusters = await clusterize(files, number_of_blocks);
const clusters = await gameConfig.clusterize(files, number_of_blocks);

return clusters.map((cluster) => {
const summary = {};
Expand Down

0 comments on commit 1e414ea

Please sign in to comment.