Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --======================================================================================================================
- --[[
- MODDED REGION DEFINITIONS
- The mod will include all imported files whose name starts with "Suk_RegionDefinitions_"
- include("Suk_RegionDefinitions_", true);
- Regions are created using a DBSCAN clustering algorithm.
- https://www.geeksforgeeks.org/dbscan-clustering-in-ml-density-based-clustering/
- Insert a new entry into g_RegionDefinitions with the following format
- g_RegionDefinitions[sRegionType] = {
- CheckerFunction = function(pPlot) return bBool end,
- MinSamples = iInt, -- Minimum number of neighbors to create cluster
- Epsilon = iInt, -- Maximum distance to consider another point a neighbor neighbors
- MinSize = iInt, -- Minimum size of cluster for it to be valid. This is BEFORE Dilation. Optional. Default 0.
- Dilate = iInt, -- How many tiles to grow the group by before finalising. Optional. Default 0.
- CoastalOnly, = bBool -- Whether to limit the FINAL cluster to only coastal tiles. Optional. False 0.
- }
- sRegionType MUST MATCH your Database entry
- the "Checker Function" determines which plots are considered valid "Nodes"
- for the algorithm
- Regions are grown from "Core Nodes", which are any Nodes with >= MinSamples number of neighbors
- Nodes are considered neighbors if the distance between them is <= Epsilon.
- Regions will include both regular and Core Nodes. It's just that regions are grown from Core Nodes.
- Regions are < MinSize are culled. MinSize defaults to 0 if not provided.
- ]]
- --======================================================================================================================
- -- DEFINITIONS
- --======================================================================================================================
- -- Forests
- -------------------------------------
- g_RegionDefinitions["REGION_SUK_FOREST"] = {
- CheckerFunction =
- function(pPlot)
- return (pPlot:GetFeatureType() == GameInfo.Features.FEATURE_FOREST.Index)
- end,
- MinSamples = 2,
- Epsilon = 1,
- MinSize = 4,
- Dilate = 1,
- }
- --======================================================================================================================
- --======================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement