tangled
alpha
login
or
join now
ptr.pet
/
endpoint
0
fork
atom
data endpoint for entity 90008 (aka. a website)
0
fork
atom
overview
issues
pulls
pipelines
constellation cleanup
ptr.pet
2 months ago
c91d0f85
41199904
verified
This commit was signed with the committer's
known signature
.
ptr.pet
SSH Key Fingerprint:
SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw=
0/0
Waiting for spindle ...
+3
-17
1 changed file
expand all
collapse all
unified
split
eunomia
src
lib
constellation.ts
+3
-17
eunomia/src/lib/constellation.ts
···
252
252
// mode-specific parameters (angles in radians)
253
253
const modeConfig = {
254
254
linear: { minAngle: 0, angleRange: Math.PI / 3, branchChance: 0.05, curlBackChance: 0.0, snapThreshold: 0.7 },
255
255
-
zigzag: { minAngle: Math.PI / 2.5, angleRange: (2 * Math.PI) / 3, branchChance: 0.10, curlBackChance: 0.0, snapThreshold: 0.6 },
255
255
+
zigzag: { minAngle: Math.PI / 4, angleRange: (2 * Math.PI) / 3, branchChance: 0.10, curlBackChance: 0.0, snapThreshold: 0.6 },
256
256
looped: { minAngle: 0, angleRange: Math.PI / 2, branchChance: 0.05, curlBackChance: 0.50, snapThreshold: 0.3 },
257
257
branching: { minAngle: 0, angleRange: Math.PI / 2, branchChance: 0.40, curlBackChance: 0.0, snapThreshold: 0.6 }
258
258
}[shapeMode];
···
823
823
for (let i = 0; i < domainPool.length; i++) {
824
824
const candidate = domainPool[i];
825
825
if (usedDomains.has(candidate.domain)) continue;
826
826
-
827
827
-
if (candidate.potential < neededTotal) {
828
828
-
// Since list is sorted, no subsequent domain will have enough potential (roughly)
829
829
-
// We can break early? No, potential is just a heuristic, graph topology differs.
830
830
-
// But generally yes. Let's start with loose check.
831
831
-
if (candidate.potential < neededTotal * 0.8) continue;
832
832
-
}
826
826
+
if (candidate.potential < neededTotal * 0.8) continue;
833
827
834
834
-
// Check Limits Dynamic (root counts)
835
828
const r = getRootDomain(candidate.domain);
836
829
const ratio = getLimitRatio(r);
837
830
if (ratio !== null) {
···
839
832
if (c >= MAX_STARS * ratio) continue;
840
833
}
841
834
842
842
-
// Perform Test Mapping
843
835
const tempMapping = new Map<number, string>();
844
836
tempMapping.set(startNode.id, candidate.domain);
845
837
const tempUsed = new Set<string>(usedDomains); // localized used set
846
838
tempUsed.add(candidate.domain);
847
847
-
848
848
-
const tempRootCounts = new Map(rootCounts); // localization is expensive?
849
849
-
// Actually we only need to track changes if we commit or just check constraints on fly
850
850
-
// We can just check constraints.
851
839
852
840
const stack = [{ shapeNodeId: startNode.id, domain: candidate.domain }];
853
841
const visitedShapeNodes = new Set<number>([startNode.id]);
···
871
859
})).sort((a, b) => b.needed - a.needed);
872
860
873
861
// Get potentials of links
874
874
-
// Optimization: We can't re-run huge BFS here. Use neighbor count (degree) as proxy or local cache.
875
875
-
// Or just re-run getDomainPotential with small limit
876
862
const linkPotentials = links.map(d => ({
877
863
d,
878
864
p: (data.linksTo[d] || []).length // Fast degree check
···
957
943
const stars = finalStars;
958
944
console.log(`Final stars generated: ${stars.length}`);
959
945
960
960
-
// 5. Generate Nebulae (Density-based) - SAME AS BEFORE
946
946
+
// 5. Generate ebulae (Density-based)
961
947
const PROBE_COUNT = 300;
962
948
const SEARCH_RADIUS = 400;
963
949
const DENSITY_THRESHOLD = 4;