@its-not-rocket-science/ananke 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +135 -0
- package/LICENSE +21 -0
- package/README.md +2199 -0
- package/STABLE_API.md +266 -0
- package/dist/src/anatomy/anatomy-compiler.d.ts +14 -0
- package/dist/src/anatomy/anatomy-compiler.js +277 -0
- package/dist/src/anatomy/anatomy-contracts.d.ts +94 -0
- package/dist/src/anatomy/anatomy-contracts.js +1 -0
- package/dist/src/anatomy/anatomy-helpers.d.ts +82 -0
- package/dist/src/anatomy/anatomy-helpers.js +233 -0
- package/dist/src/anatomy/anatomy-schema.d.ts +28 -0
- package/dist/src/anatomy/anatomy-schema.js +388 -0
- package/dist/src/anatomy/index.d.ts +4 -0
- package/dist/src/anatomy/index.js +4 -0
- package/dist/src/archetypes.d.ts +87 -0
- package/dist/src/archetypes.js +285 -0
- package/dist/src/arena.d.ts +173 -0
- package/dist/src/arena.js +695 -0
- package/dist/src/bridge/bridge-engine.d.ts +46 -0
- package/dist/src/bridge/bridge-engine.js +252 -0
- package/dist/src/bridge/index.d.ts +4 -0
- package/dist/src/bridge/index.js +5 -0
- package/dist/src/bridge/interpolation.d.ts +64 -0
- package/dist/src/bridge/interpolation.js +130 -0
- package/dist/src/bridge/mapping.d.ts +33 -0
- package/dist/src/bridge/mapping.js +54 -0
- package/dist/src/bridge/types.d.ts +94 -0
- package/dist/src/bridge/types.js +2 -0
- package/dist/src/campaign.d.ts +141 -0
- package/dist/src/campaign.js +235 -0
- package/dist/src/channels.d.ts +15 -0
- package/dist/src/channels.js +20 -0
- package/dist/src/chronicle.d.ts +124 -0
- package/dist/src/chronicle.js +232 -0
- package/dist/src/collective-activities.d.ts +154 -0
- package/dist/src/collective-activities.js +247 -0
- package/dist/src/competence/acoustic.d.ts +101 -0
- package/dist/src/competence/acoustic.js +242 -0
- package/dist/src/competence/catalogue.d.ts +30 -0
- package/dist/src/competence/catalogue.js +241 -0
- package/dist/src/competence/crafting.d.ts +35 -0
- package/dist/src/competence/crafting.js +88 -0
- package/dist/src/competence/engineering.d.ts +53 -0
- package/dist/src/competence/engineering.js +108 -0
- package/dist/src/competence/framework.d.ts +68 -0
- package/dist/src/competence/framework.js +694 -0
- package/dist/src/competence/index.d.ts +12 -0
- package/dist/src/competence/index.js +13 -0
- package/dist/src/competence/interspecies.d.ts +81 -0
- package/dist/src/competence/interspecies.js +108 -0
- package/dist/src/competence/language.d.ts +79 -0
- package/dist/src/competence/language.js +115 -0
- package/dist/src/competence/naturalist.d.ts +97 -0
- package/dist/src/competence/naturalist.js +187 -0
- package/dist/src/competence/navigation.d.ts +24 -0
- package/dist/src/competence/navigation.js +48 -0
- package/dist/src/competence/performance.d.ts +125 -0
- package/dist/src/competence/performance.js +210 -0
- package/dist/src/competence/teaching.d.ts +64 -0
- package/dist/src/competence/teaching.js +121 -0
- package/dist/src/competence/willpower.d.ts +74 -0
- package/dist/src/competence/willpower.js +114 -0
- package/dist/src/crafting/index.d.ts +55 -0
- package/dist/src/crafting/index.js +229 -0
- package/dist/src/crafting/manufacturing.d.ts +83 -0
- package/dist/src/crafting/manufacturing.js +165 -0
- package/dist/src/crafting/materials.d.ts +53 -0
- package/dist/src/crafting/materials.js +120 -0
- package/dist/src/crafting/recipes.d.ts +75 -0
- package/dist/src/crafting/recipes.js +233 -0
- package/dist/src/crafting/workshops.d.ts +61 -0
- package/dist/src/crafting/workshops.js +170 -0
- package/dist/src/debug.d.ts +86 -0
- package/dist/src/debug.js +76 -0
- package/dist/src/derive.d.ts +21 -0
- package/dist/src/derive.js +88 -0
- package/dist/src/describe.d.ts +29 -0
- package/dist/src/describe.js +276 -0
- package/dist/src/dialogue.d.ts +122 -0
- package/dist/src/dialogue.js +266 -0
- package/dist/src/dist.d.ts +20 -0
- package/dist/src/dist.js +39 -0
- package/dist/src/downtime.d.ts +89 -0
- package/dist/src/downtime.js +391 -0
- package/dist/src/economy.d.ts +116 -0
- package/dist/src/economy.js +182 -0
- package/dist/src/emotional-contagion.d.ts +142 -0
- package/dist/src/emotional-contagion.js +274 -0
- package/dist/src/equipment.d.ts +206 -0
- package/dist/src/equipment.js +598 -0
- package/dist/src/faction.d.ts +102 -0
- package/dist/src/faction.js +237 -0
- package/dist/src/generate.d.ts +35 -0
- package/dist/src/generate.js +166 -0
- package/dist/src/index.d.ts +42 -0
- package/dist/src/index.js +54 -0
- package/dist/src/inheritance.d.ts +69 -0
- package/dist/src/inheritance.js +136 -0
- package/dist/src/inventory.d.ts +194 -0
- package/dist/src/inventory.js +637 -0
- package/dist/src/item-durability.d.ts +69 -0
- package/dist/src/item-durability.js +308 -0
- package/dist/src/legend.d.ts +97 -0
- package/dist/src/legend.js +269 -0
- package/dist/src/lod.d.ts +9 -0
- package/dist/src/lod.js +84 -0
- package/dist/src/metrics.d.ts +51 -0
- package/dist/src/metrics.js +91 -0
- package/dist/src/model3d.d.ts +138 -0
- package/dist/src/model3d.js +214 -0
- package/dist/src/mythology.d.ts +101 -0
- package/dist/src/mythology.js +308 -0
- package/dist/src/narrative-render.d.ts +42 -0
- package/dist/src/narrative-render.js +194 -0
- package/dist/src/narrative-stress.d.ts +123 -0
- package/dist/src/narrative-stress.js +183 -0
- package/dist/src/narrative.d.ts +44 -0
- package/dist/src/narrative.js +257 -0
- package/dist/src/party.d.ts +70 -0
- package/dist/src/party.js +226 -0
- package/dist/src/polity.d.ts +262 -0
- package/dist/src/polity.js +398 -0
- package/dist/src/presets.d.ts +42 -0
- package/dist/src/presets.js +170 -0
- package/dist/src/progression.d.ts +170 -0
- package/dist/src/progression.js +256 -0
- package/dist/src/quest-generators.d.ts +76 -0
- package/dist/src/quest-generators.js +534 -0
- package/dist/src/quest.d.ts +239 -0
- package/dist/src/quest.js +520 -0
- package/dist/src/relationships-effects.d.ts +75 -0
- package/dist/src/relationships-effects.js +219 -0
- package/dist/src/relationships.d.ts +104 -0
- package/dist/src/relationships.js +347 -0
- package/dist/src/replay.d.ts +47 -0
- package/dist/src/replay.js +82 -0
- package/dist/src/rng.d.ts +9 -0
- package/dist/src/rng.js +37 -0
- package/dist/src/settlement-services.d.ts +67 -0
- package/dist/src/settlement-services.js +267 -0
- package/dist/src/settlement.d.ts +143 -0
- package/dist/src/settlement.js +419 -0
- package/dist/src/sim/action.d.ts +28 -0
- package/dist/src/sim/action.js +12 -0
- package/dist/src/sim/aging.d.ts +95 -0
- package/dist/src/sim/aging.js +243 -0
- package/dist/src/sim/ai/decide.d.ts +10 -0
- package/dist/src/sim/ai/decide.js +267 -0
- package/dist/src/sim/ai/perception.d.ts +12 -0
- package/dist/src/sim/ai/perception.js +54 -0
- package/dist/src/sim/ai/personality.d.ts +54 -0
- package/dist/src/sim/ai/personality.js +202 -0
- package/dist/src/sim/ai/presets.d.ts +2 -0
- package/dist/src/sim/ai/presets.js +28 -0
- package/dist/src/sim/ai/system.d.ts +6 -0
- package/dist/src/sim/ai/system.js +13 -0
- package/dist/src/sim/ai/targeting.d.ts +8 -0
- package/dist/src/sim/ai/targeting.js +42 -0
- package/dist/src/sim/ai/types.d.ts +14 -0
- package/dist/src/sim/ai/types.js +1 -0
- package/dist/src/sim/body.d.ts +9 -0
- package/dist/src/sim/body.js +32 -0
- package/dist/src/sim/bodyplan.d.ts +161 -0
- package/dist/src/sim/bodyplan.js +677 -0
- package/dist/src/sim/capability.d.ts +135 -0
- package/dist/src/sim/capability.js +8 -0
- package/dist/src/sim/combat.d.ts +21 -0
- package/dist/src/sim/combat.js +77 -0
- package/dist/src/sim/commandBuilders.d.ts +11 -0
- package/dist/src/sim/commandBuilders.js +39 -0
- package/dist/src/sim/commands.d.ts +71 -0
- package/dist/src/sim/commands.js +8 -0
- package/dist/src/sim/condition.d.ts +35 -0
- package/dist/src/sim/condition.js +21 -0
- package/dist/src/sim/cone.d.ts +40 -0
- package/dist/src/sim/cone.js +44 -0
- package/dist/src/sim/context.d.ts +68 -0
- package/dist/src/sim/context.js +1 -0
- package/dist/src/sim/density.d.ts +14 -0
- package/dist/src/sim/density.js +33 -0
- package/dist/src/sim/disease.d.ts +141 -0
- package/dist/src/sim/disease.js +353 -0
- package/dist/src/sim/entity.d.ts +251 -0
- package/dist/src/sim/entity.js +19 -0
- package/dist/src/sim/events.d.ts +25 -0
- package/dist/src/sim/events.js +5 -0
- package/dist/src/sim/explosion.d.ts +40 -0
- package/dist/src/sim/explosion.js +40 -0
- package/dist/src/sim/formation-unit.d.ts +138 -0
- package/dist/src/sim/formation-unit.js +197 -0
- package/dist/src/sim/formation.d.ts +12 -0
- package/dist/src/sim/formation.js +54 -0
- package/dist/src/sim/frontage.d.ts +30 -0
- package/dist/src/sim/frontage.js +84 -0
- package/dist/src/sim/grapple.d.ts +100 -0
- package/dist/src/sim/grapple.js +480 -0
- package/dist/src/sim/hazard.d.ts +104 -0
- package/dist/src/sim/hazard.js +201 -0
- package/dist/src/sim/hydrostatic.d.ts +58 -0
- package/dist/src/sim/hydrostatic.js +117 -0
- package/dist/src/sim/impairment.d.ts +20 -0
- package/dist/src/sim/impairment.js +162 -0
- package/dist/src/sim/indexing.d.ts +7 -0
- package/dist/src/sim/indexing.js +7 -0
- package/dist/src/sim/injury.d.ts +54 -0
- package/dist/src/sim/injury.js +66 -0
- package/dist/src/sim/intent.d.ts +26 -0
- package/dist/src/sim/intent.js +7 -0
- package/dist/src/sim/kernel.d.ts +45 -0
- package/dist/src/sim/kernel.js +1992 -0
- package/dist/src/sim/kinds.d.ts +64 -0
- package/dist/src/sim/kinds.js +56 -0
- package/dist/src/sim/knockback.d.ts +50 -0
- package/dist/src/sim/knockback.js +82 -0
- package/dist/src/sim/limb.d.ts +48 -0
- package/dist/src/sim/limb.js +78 -0
- package/dist/src/sim/medical.d.ts +32 -0
- package/dist/src/sim/medical.js +33 -0
- package/dist/src/sim/morale.d.ts +69 -0
- package/dist/src/sim/morale.js +92 -0
- package/dist/src/sim/mount.d.ts +150 -0
- package/dist/src/sim/mount.js +225 -0
- package/dist/src/sim/nutrition.d.ts +74 -0
- package/dist/src/sim/nutrition.js +168 -0
- package/dist/src/sim/occlusion.d.ts +8 -0
- package/dist/src/sim/occlusion.js +71 -0
- package/dist/src/sim/push.d.ts +11 -0
- package/dist/src/sim/push.js +79 -0
- package/dist/src/sim/ranged.d.ts +44 -0
- package/dist/src/sim/ranged.js +69 -0
- package/dist/src/sim/seeds.d.ts +3 -0
- package/dist/src/sim/seeds.js +16 -0
- package/dist/src/sim/sensory-extended.d.ts +103 -0
- package/dist/src/sim/sensory-extended.js +181 -0
- package/dist/src/sim/sensory.d.ts +38 -0
- package/dist/src/sim/sensory.js +109 -0
- package/dist/src/sim/skills.d.ts +70 -0
- package/dist/src/sim/skills.js +69 -0
- package/dist/src/sim/sleep.d.ts +107 -0
- package/dist/src/sim/sleep.js +215 -0
- package/dist/src/sim/spatial.d.ts +8 -0
- package/dist/src/sim/spatial.js +59 -0
- package/dist/src/sim/step/capability.d.ts +8 -0
- package/dist/src/sim/step/capability.js +77 -0
- package/dist/src/sim/step/concentration.d.ts +9 -0
- package/dist/src/sim/step/concentration.js +25 -0
- package/dist/src/sim/step/effects.d.ts +17 -0
- package/dist/src/sim/step/effects.js +96 -0
- package/dist/src/sim/step/energy.d.ts +3 -0
- package/dist/src/sim/step/energy.js +31 -0
- package/dist/src/sim/step/hazards.d.ts +4 -0
- package/dist/src/sim/step/hazards.js +19 -0
- package/dist/src/sim/step/injury.d.ts +10 -0
- package/dist/src/sim/step/injury.js +353 -0
- package/dist/src/sim/step/morale.d.ts +11 -0
- package/dist/src/sim/step/morale.js +130 -0
- package/dist/src/sim/step/movement.d.ts +5 -0
- package/dist/src/sim/step/movement.js +172 -0
- package/dist/src/sim/step/push.d.ts +11 -0
- package/dist/src/sim/step/push.js +79 -0
- package/dist/src/sim/step/substances.d.ts +3 -0
- package/dist/src/sim/step/substances.js +75 -0
- package/dist/src/sim/substance.d.ts +38 -0
- package/dist/src/sim/substance.js +57 -0
- package/dist/src/sim/systemic-toxicology.d.ts +109 -0
- package/dist/src/sim/systemic-toxicology.js +263 -0
- package/dist/src/sim/team.d.ts +9 -0
- package/dist/src/sim/team.js +37 -0
- package/dist/src/sim/tech.d.ts +36 -0
- package/dist/src/sim/tech.js +46 -0
- package/dist/src/sim/terrain.d.ts +121 -0
- package/dist/src/sim/terrain.js +141 -0
- package/dist/src/sim/testing.d.ts +13 -0
- package/dist/src/sim/testing.js +100 -0
- package/dist/src/sim/thermoregulation.d.ts +77 -0
- package/dist/src/sim/thermoregulation.js +161 -0
- package/dist/src/sim/tick.d.ts +3 -0
- package/dist/src/sim/tick.js +3 -0
- package/dist/src/sim/toxicology.d.ts +52 -0
- package/dist/src/sim/toxicology.js +104 -0
- package/dist/src/sim/trace.d.ts +141 -0
- package/dist/src/sim/trace.js +1 -0
- package/dist/src/sim/tuning.d.ts +16 -0
- package/dist/src/sim/tuning.js +42 -0
- package/dist/src/sim/vec3.d.ts +14 -0
- package/dist/src/sim/vec3.js +31 -0
- package/dist/src/sim/weapon_dynamics.d.ts +102 -0
- package/dist/src/sim/weapon_dynamics.js +142 -0
- package/dist/src/sim/weather.d.ts +95 -0
- package/dist/src/sim/weather.js +105 -0
- package/dist/src/sim/world.d.ts +52 -0
- package/dist/src/sim/world.js +1 -0
- package/dist/src/sim/wound-aging.d.ts +120 -0
- package/dist/src/sim/wound-aging.js +223 -0
- package/dist/src/species.d.ts +106 -0
- package/dist/src/species.js +664 -0
- package/dist/src/story-arcs.d.ts +17 -0
- package/dist/src/story-arcs.js +276 -0
- package/dist/src/tech-diffusion.d.ts +80 -0
- package/dist/src/tech-diffusion.js +185 -0
- package/dist/src/traits.d.ts +25 -0
- package/dist/src/traits.js +178 -0
- package/dist/src/types.d.ts +117 -0
- package/dist/src/types.js +1 -0
- package/dist/src/units.d.ts +41 -0
- package/dist/src/units.js +64 -0
- package/dist/src/weapons.d.ts +20 -0
- package/dist/src/weapons.js +824 -0
- package/dist/src/world-generation.d.ts +52 -0
- package/dist/src/world-generation.js +301 -0
- package/package.json +74 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/competence/index.ts — Phase 34-40: Competence module re-exports
|
|
2
|
+
export * from "./crafting.js";
|
|
3
|
+
export * from "./navigation.js";
|
|
4
|
+
export * from "./naturalist.js";
|
|
5
|
+
export * from "./interspecies.js";
|
|
6
|
+
export * from "./language.js";
|
|
7
|
+
export * from "./teaching.js";
|
|
8
|
+
export * from "./willpower.js";
|
|
9
|
+
export * from "./engineering.js";
|
|
10
|
+
export * from "./acoustic.js";
|
|
11
|
+
export * from "./performance.js";
|
|
12
|
+
export * from "./catalogue.js";
|
|
13
|
+
export * from "./framework.js";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Q, I32 } from "../units.js";
|
|
2
|
+
import type { Entity } from "../sim/entity.js";
|
|
3
|
+
/**
|
|
4
|
+
* Inter-species profile tracking empathy and species-specific comprehension.
|
|
5
|
+
*/
|
|
6
|
+
export interface InterSpeciesProfile {
|
|
7
|
+
/** Base empathy quotient for cross-species interaction. */
|
|
8
|
+
empathy_Q: Q;
|
|
9
|
+
/** Species IDs with which the entity has deep familiarity. */
|
|
10
|
+
speciesAffinity: string[];
|
|
11
|
+
/** Map of species ID → comprehension quality for signaling. */
|
|
12
|
+
signalVocab: Map<string, Q>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Signal action for cross-species communication (non-verbal).
|
|
16
|
+
*/
|
|
17
|
+
export interface SignalSpec {
|
|
18
|
+
/** Target species to signal. */
|
|
19
|
+
targetSpecies: string;
|
|
20
|
+
/** Intent being communicated. */
|
|
21
|
+
intent: "calm" | "submit" | "ally" | "territory";
|
|
22
|
+
/** Base fear level of the target animal/entity (0 = calm, 1 = terrified). */
|
|
23
|
+
targetFearQ: Q;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Outcome of a signal attempt.
|
|
27
|
+
*/
|
|
28
|
+
export interface SignalOutcome {
|
|
29
|
+
/** True if signal was successfully communicated and understood. */
|
|
30
|
+
success: boolean;
|
|
31
|
+
/** Quality of comprehension (0–1). */
|
|
32
|
+
comprehension_Q: Q;
|
|
33
|
+
/** True if signal aggravated the target (hostile misinterpretation). */
|
|
34
|
+
aggravated: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Latency penalty context for unfamiliar species combat.
|
|
38
|
+
*/
|
|
39
|
+
export interface UnfamiliarSpeciesContext {
|
|
40
|
+
/** The entity making decisions. */
|
|
41
|
+
entity: Entity;
|
|
42
|
+
/** Species ID of the opponent. */
|
|
43
|
+
opponentSpecies: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Compute latency penalty when facing an unfamiliar species.
|
|
47
|
+
*
|
|
48
|
+
* Formula: latencyPenalty_ms = (1.0 − interSpecies) × 0.080 (up to +80ms)
|
|
49
|
+
*
|
|
50
|
+
* @param entity - The entity experiencing unfamiliarity penalty.
|
|
51
|
+
* @param opponentSpecies - Species ID of the opponent.
|
|
52
|
+
* @returns Penalty in milliseconds (fixed-point I32), or 0 if species is familiar.
|
|
53
|
+
*/
|
|
54
|
+
export declare function computeUnfamiliarSpeciesLatencyPenalty(entity: Entity, opponentSpecies: string): I32;
|
|
55
|
+
/**
|
|
56
|
+
* Resolve a cross-species signal attempt.
|
|
57
|
+
*
|
|
58
|
+
* Formula:
|
|
59
|
+
* P_success = empathy_Q × signalVocab(targetSpecies) × (1 − animalFearQ × 0.60)
|
|
60
|
+
* aggravated = (empathy_Q < AGGRAVATION_THRESHOLD) && (targetFearQ > q(0.50))
|
|
61
|
+
*
|
|
62
|
+
* @param entity - The entity sending the signal.
|
|
63
|
+
* @param spec - Signal specification.
|
|
64
|
+
* @param seed - Deterministic seed for RNG variance.
|
|
65
|
+
* @returns Signal outcome with success, comprehension quality, and aggravation flag.
|
|
66
|
+
*/
|
|
67
|
+
export declare function resolveSignal(entity: Entity, spec: SignalSpec, seed: number): SignalOutcome;
|
|
68
|
+
/**
|
|
69
|
+
* Check if entity has affinity with a given species.
|
|
70
|
+
*/
|
|
71
|
+
export declare function hasSpeciesAffinity(entity: Entity, species: string): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Build a default signal vocabulary for a species.
|
|
74
|
+
* Used for populating default comprehension levels.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildDefaultSignalVocab(speciesId: string): Map<string, Q>;
|
|
77
|
+
/**
|
|
78
|
+
* Get effective inter-species empathy for an entity.
|
|
79
|
+
* Returns interSpecies cognition value, or default q(0.35) if absent.
|
|
80
|
+
*/
|
|
81
|
+
export declare function getEffectiveEmpathy(entity: Entity): Q;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// src/competence/interspecies.ts — Phase 36: Inter-Species Intelligence & Xenodiplomacy
|
|
2
|
+
//
|
|
3
|
+
// Inter-species intelligence models the ability to understand, read, and communicate
|
|
4
|
+
// with minds operating on fundamentally different cognitive and sensory substrates.
|
|
5
|
+
//
|
|
6
|
+
// No kernel import — pure resolution module.
|
|
7
|
+
import { SCALE, q, clampQ, qMul, mulDiv } from "../units.js";
|
|
8
|
+
import { makeRng } from "../rng.js";
|
|
9
|
+
// ── Constants ─────────────────────────────────────────────────────────────────
|
|
10
|
+
/** Maximum latency penalty in milliseconds (80ms at interSpecies q(0.0)). */
|
|
11
|
+
const MAX_LATENCY_PENALTY_MS = 80 * SCALE.s / 1000; // 80ms in Q-units
|
|
12
|
+
/** Scaling factor: penalty = (1.0 − interSpecies) × MAX_LATENCY_PENALTY_MS. */
|
|
13
|
+
const LATENCY_PENALTY_SCALE = MAX_LATENCY_PENALTY_MS;
|
|
14
|
+
/** Base success probability for signaling without vocabulary. */
|
|
15
|
+
const SIGNAL_BASE_PROBABILITY = q(0.10);
|
|
16
|
+
/** Aggravation threshold: low empathy + high fear → possible hostile reaction. */
|
|
17
|
+
const AGGRAVATION_THRESHOLD = q(0.30);
|
|
18
|
+
// ── Public API ────────────────────────────────────────────────────────────────
|
|
19
|
+
/**
|
|
20
|
+
* Compute latency penalty when facing an unfamiliar species.
|
|
21
|
+
*
|
|
22
|
+
* Formula: latencyPenalty_ms = (1.0 − interSpecies) × 0.080 (up to +80ms)
|
|
23
|
+
*
|
|
24
|
+
* @param entity - The entity experiencing unfamiliarity penalty.
|
|
25
|
+
* @param opponentSpecies - Species ID of the opponent.
|
|
26
|
+
* @returns Penalty in milliseconds (fixed-point I32), or 0 if species is familiar.
|
|
27
|
+
*/
|
|
28
|
+
export function computeUnfamiliarSpeciesLatencyPenalty(entity, opponentSpecies) {
|
|
29
|
+
// Check if entity has affinity with opponent species
|
|
30
|
+
const affinity = entity.attributes.cognition?.speciesAffinity ?? [];
|
|
31
|
+
if (affinity.includes(opponentSpecies)) {
|
|
32
|
+
return 0; // No penalty for familiar species
|
|
33
|
+
}
|
|
34
|
+
const interSpecies = (entity.attributes.cognition?.interSpecies ?? q(0.35));
|
|
35
|
+
// penalty_ms = (SCALE.Q - interSpecies) / SCALE.Q × 80ms
|
|
36
|
+
const penaltyScale = clampQ((SCALE.Q - interSpecies), 0, SCALE.Q);
|
|
37
|
+
const penaltyMs = mulDiv(penaltyScale, LATENCY_PENALTY_SCALE, SCALE.Q);
|
|
38
|
+
return penaltyMs;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolve a cross-species signal attempt.
|
|
42
|
+
*
|
|
43
|
+
* Formula:
|
|
44
|
+
* P_success = empathy_Q × signalVocab(targetSpecies) × (1 − animalFearQ × 0.60)
|
|
45
|
+
* aggravated = (empathy_Q < AGGRAVATION_THRESHOLD) && (targetFearQ > q(0.50))
|
|
46
|
+
*
|
|
47
|
+
* @param entity - The entity sending the signal.
|
|
48
|
+
* @param spec - Signal specification.
|
|
49
|
+
* @param seed - Deterministic seed for RNG variance.
|
|
50
|
+
* @returns Signal outcome with success, comprehension quality, and aggravation flag.
|
|
51
|
+
*/
|
|
52
|
+
export function resolveSignal(entity, spec, seed) {
|
|
53
|
+
const interSpecies = (entity.attributes.cognition?.interSpecies ?? q(0.35));
|
|
54
|
+
const empathy_Q = interSpecies; // Use interSpecies as empathy base
|
|
55
|
+
// Get vocabulary comprehension for target species
|
|
56
|
+
const vocab = entity.attributes.cognition?.signalVocab ?? new Map();
|
|
57
|
+
const vocabComp = vocab.get(spec.targetSpecies) ?? q(0.20);
|
|
58
|
+
// Base success probability
|
|
59
|
+
const baseProb = clampQ(qMul(empathy_Q, vocabComp), q(0), SCALE.Q);
|
|
60
|
+
// Fear penalty: fearful targets are harder to communicate with
|
|
61
|
+
// P_success *= (1 − fear × 0.60)
|
|
62
|
+
const fearPenalty = mulDiv(spec.targetFearQ, q(0.60), SCALE.Q);
|
|
63
|
+
const fearMul = clampQ((SCALE.Q - fearPenalty), q(0.20), SCALE.Q);
|
|
64
|
+
const finalProb = clampQ(qMul(baseProb, fearMul), q(0), SCALE.Q);
|
|
65
|
+
// RNG check
|
|
66
|
+
const rng = makeRng(seed, SCALE.Q);
|
|
67
|
+
const roll = rng.q01();
|
|
68
|
+
const success = roll < finalProb;
|
|
69
|
+
// Comprehension quality: empathy × vocab × (0.7–1.1 RNG variance)
|
|
70
|
+
const varianceRoll = rng.q01();
|
|
71
|
+
const variance = clampQ((q(0.70) + mulDiv(varianceRoll, q(0.40), SCALE.Q)), q(0.70), q(1.10));
|
|
72
|
+
const comprehension_Q = clampQ(qMul(qMul(empathy_Q, vocabComp), variance), q(0), SCALE.Q);
|
|
73
|
+
// Aggravation check: low empathy + fearful target can trigger hostile reaction
|
|
74
|
+
const aggravated = empathy_Q < AGGRAVATION_THRESHOLD && spec.targetFearQ > q(0.50);
|
|
75
|
+
return { success, comprehension_Q, aggravated };
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Check if entity has affinity with a given species.
|
|
79
|
+
*/
|
|
80
|
+
export function hasSpeciesAffinity(entity, species) {
|
|
81
|
+
const affinity = entity.attributes.cognition?.speciesAffinity ?? [];
|
|
82
|
+
return affinity.includes(species);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Build a default signal vocabulary for a species.
|
|
86
|
+
* Used for populating default comprehension levels.
|
|
87
|
+
*/
|
|
88
|
+
export function buildDefaultSignalVocab(speciesId) {
|
|
89
|
+
const vocab = new Map();
|
|
90
|
+
// Default low comprehension with most species
|
|
91
|
+
const commonSpecies = ["human", "elf", "dwarf", "orc", "goblin", "troll", "wolf", "bear"];
|
|
92
|
+
for (const s of commonSpecies) {
|
|
93
|
+
if (s !== speciesId) {
|
|
94
|
+
vocab.set(s, q(0.15));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Higher comprehension with own species
|
|
98
|
+
vocab.set(speciesId, q(0.80));
|
|
99
|
+
return vocab;
|
|
100
|
+
}
|
|
101
|
+
// ── Backward compatibility helpers ────────────────────────────────────────────
|
|
102
|
+
/**
|
|
103
|
+
* Get effective inter-species empathy for an entity.
|
|
104
|
+
* Returns interSpecies cognition value, or default q(0.35) if absent.
|
|
105
|
+
*/
|
|
106
|
+
export function getEffectiveEmpathy(entity) {
|
|
107
|
+
return (entity.attributes.cognition?.interSpecies ?? q(0.35));
|
|
108
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Q } from "../units.js";
|
|
2
|
+
import type { Entity } from "../sim/entity.js";
|
|
3
|
+
/**
|
|
4
|
+
* Language capacity with fluency level.
|
|
5
|
+
*/
|
|
6
|
+
export interface LanguageCapacity {
|
|
7
|
+
/** Language identifier (e.g., "common", "elvish", "klingonese"). */
|
|
8
|
+
languageId: string;
|
|
9
|
+
/** Fluency level: q(1.0) = native, q(0.50) = conversational, q(0.20) = survival. */
|
|
10
|
+
fluency_Q: Q;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Outcome of a command transmission to a formation.
|
|
14
|
+
*/
|
|
15
|
+
export interface CommandTransmission {
|
|
16
|
+
/** Fraction of formation receiving correctly (0–1). */
|
|
17
|
+
receptionRate_Q: Q;
|
|
18
|
+
/** Delay in ticks before command is fully transmitted. */
|
|
19
|
+
transmissionDelay_ticks: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Specification for language-based communication check.
|
|
23
|
+
*/
|
|
24
|
+
export interface LanguageCheckSpec {
|
|
25
|
+
/** Target language being used. */
|
|
26
|
+
targetLanguage: string;
|
|
27
|
+
/** Minimum fluency required for the communication. */
|
|
28
|
+
minFluency_Q?: Q;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Outcome of a language check.
|
|
32
|
+
*/
|
|
33
|
+
export interface LanguageCheckOutcome {
|
|
34
|
+
/** True if entity has sufficient fluency. */
|
|
35
|
+
canCommunicate: boolean;
|
|
36
|
+
/** Entity's fluency in the target language. */
|
|
37
|
+
fluency_Q: Q;
|
|
38
|
+
/** Communication quality multiplier (0–1). */
|
|
39
|
+
qualityMul_Q: Q;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get entity's fluency in a specific language.
|
|
43
|
+
* Returns default q(0.50) if no languages defined or language not found.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getLanguageFluency(entity: Entity, languageId: string): Q;
|
|
46
|
+
/**
|
|
47
|
+
* Check if entity can communicate in a language and at what quality.
|
|
48
|
+
*/
|
|
49
|
+
export declare function checkLanguage(entity: Entity, spec: LanguageCheckSpec): LanguageCheckOutcome;
|
|
50
|
+
/**
|
|
51
|
+
* Compute communication penalty between two entities speaking different languages.
|
|
52
|
+
* Returns the minimum fluency between initiator's target language and target's response language.
|
|
53
|
+
*/
|
|
54
|
+
export declare function computeLanguageBarrier(initiator: Entity, target: Entity, initiatorLanguage: string, targetLanguage: string): Q;
|
|
55
|
+
/**
|
|
56
|
+
* Resolve command transmission to a formation.
|
|
57
|
+
*
|
|
58
|
+
* Formula:
|
|
59
|
+
* receptionRate_Q = linguistic × formationBonus(formationSize)
|
|
60
|
+
* transmissionDelay_ticks = ceil(formationSize / (linguistic × 20))
|
|
61
|
+
*
|
|
62
|
+
* @param commander - The entity issuing commands.
|
|
63
|
+
* @param formationSize - Number of units in the formation.
|
|
64
|
+
* @returns Command transmission outcome.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveCommandTransmission(commander: Entity, formationSize: number): CommandTransmission;
|
|
67
|
+
/**
|
|
68
|
+
* Compute effective command range based on linguistic skill.
|
|
69
|
+
* Higher linguistic = commands carry farther.
|
|
70
|
+
*/
|
|
71
|
+
export declare function computeCommandRange_m(commander: Entity): number;
|
|
72
|
+
/**
|
|
73
|
+
* Check if entity has any language capacity defined.
|
|
74
|
+
*/
|
|
75
|
+
export declare function hasLanguageCapacity(entity: Entity): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Get native language (fluency >= 0.80) or highest fluency language.
|
|
78
|
+
*/
|
|
79
|
+
export declare function getPrimaryLanguage(entity: Entity): string | undefined;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// src/competence/language.ts — Phase 37: Linguistic Intelligence
|
|
2
|
+
//
|
|
3
|
+
// Linguistic intelligence governs command clarity, multilingual competence,
|
|
4
|
+
// persuasive argument structure, and written record quality.
|
|
5
|
+
//
|
|
6
|
+
// No kernel import — pure resolution module.
|
|
7
|
+
import { SCALE, q, clampQ, qMul, mulDiv } from "../units.js";
|
|
8
|
+
// ── Constants ─────────────────────────────────────────────────────────────────
|
|
9
|
+
/** Base reception rate at linguistic q(0.50) for formation size 1. */
|
|
10
|
+
const BASE_RECEPTION_RATE = q(0.70);
|
|
11
|
+
/** Maximum formation size before reception penalties apply. */
|
|
12
|
+
const OPTIMAL_FORMATION_SIZE = 10;
|
|
13
|
+
/** Base delay divisor: linguistic × BASE_DELAY_DIVISOR. */
|
|
14
|
+
const BASE_DELAY_DIVISOR = 20;
|
|
15
|
+
/** Minimum fluency for basic communication. */
|
|
16
|
+
const MIN_FLUENCY_THRESHOLD = q(0.10);
|
|
17
|
+
/** Default fluency when entity has no languages defined. */
|
|
18
|
+
const DEFAULT_FLUENCY = q(0.50);
|
|
19
|
+
// ── Public API ────────────────────────────────────────────────────────────────
|
|
20
|
+
/**
|
|
21
|
+
* Get entity's fluency in a specific language.
|
|
22
|
+
* Returns default q(0.50) if no languages defined or language not found.
|
|
23
|
+
*/
|
|
24
|
+
export function getLanguageFluency(entity, languageId) {
|
|
25
|
+
const languages = entity.attributes.languages;
|
|
26
|
+
if (!languages || languages.length === 0) {
|
|
27
|
+
return DEFAULT_FLUENCY;
|
|
28
|
+
}
|
|
29
|
+
const lang = languages.find((l) => l.languageId === languageId);
|
|
30
|
+
return lang?.fluency_Q ?? MIN_FLUENCY_THRESHOLD;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check if entity can communicate in a language and at what quality.
|
|
34
|
+
*/
|
|
35
|
+
export function checkLanguage(entity, spec) {
|
|
36
|
+
const fluency_Q = getLanguageFluency(entity, spec.targetLanguage);
|
|
37
|
+
const minFluency = spec.minFluency_Q ?? MIN_FLUENCY_THRESHOLD;
|
|
38
|
+
const canCommunicate = fluency_Q >= minFluency;
|
|
39
|
+
// Quality multiplier scales with fluency above minimum
|
|
40
|
+
const qualityMul_Q = canCommunicate
|
|
41
|
+
? clampQ(mulDiv(fluency_Q, SCALE.Q, q(1.0)), q(0.20), SCALE.Q)
|
|
42
|
+
: q(0);
|
|
43
|
+
return { canCommunicate, fluency_Q, qualityMul_Q };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Compute communication penalty between two entities speaking different languages.
|
|
47
|
+
* Returns the minimum fluency between initiator's target language and target's response language.
|
|
48
|
+
*/
|
|
49
|
+
export function computeLanguageBarrier(initiator, target, initiatorLanguage, targetLanguage) {
|
|
50
|
+
const initiatorFluency = getLanguageFluency(initiator, initiatorLanguage);
|
|
51
|
+
const targetFluency = getLanguageFluency(target, targetLanguage);
|
|
52
|
+
// Communication limited by the least fluent participant
|
|
53
|
+
return Math.min(initiatorFluency, targetFluency);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Resolve command transmission to a formation.
|
|
57
|
+
*
|
|
58
|
+
* Formula:
|
|
59
|
+
* receptionRate_Q = linguistic × formationBonus(formationSize)
|
|
60
|
+
* transmissionDelay_ticks = ceil(formationSize / (linguistic × 20))
|
|
61
|
+
*
|
|
62
|
+
* @param commander - The entity issuing commands.
|
|
63
|
+
* @param formationSize - Number of units in the formation.
|
|
64
|
+
* @returns Command transmission outcome.
|
|
65
|
+
*/
|
|
66
|
+
export function resolveCommandTransmission(commander, formationSize) {
|
|
67
|
+
const linguistic = (commander.attributes.cognition?.linguistic ?? q(0.50));
|
|
68
|
+
// Formation size penalty: larger formations are harder to coordinate
|
|
69
|
+
// Bonus = 1.0 for size <= 10, then degrades linearly
|
|
70
|
+
const sizePenalty = Math.max(0, formationSize - OPTIMAL_FORMATION_SIZE);
|
|
71
|
+
const formationBonus = clampQ((SCALE.Q - mulDiv(sizePenalty, q(0.02), SCALE.Q)), q(0.30), SCALE.Q);
|
|
72
|
+
// Reception rate: linguistic skill × formation size bonus
|
|
73
|
+
const receptionRate_Q = clampQ(qMul(linguistic, formationBonus), q(0.10), SCALE.Q);
|
|
74
|
+
// Delay: larger formations + lower linguistic = more delay
|
|
75
|
+
// delay = ceil(formationSize / (linguistic × 20))
|
|
76
|
+
const linguisticFactor = Math.max(1, mulDiv(linguistic, BASE_DELAY_DIVISOR, SCALE.Q));
|
|
77
|
+
const transmissionDelay_ticks = Math.ceil(formationSize / linguisticFactor);
|
|
78
|
+
return { receptionRate_Q, transmissionDelay_ticks };
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Compute effective command range based on linguistic skill.
|
|
82
|
+
* Higher linguistic = commands carry farther.
|
|
83
|
+
*/
|
|
84
|
+
export function computeCommandRange_m(commander) {
|
|
85
|
+
const linguistic = (commander.attributes.cognition?.linguistic ?? q(0.50));
|
|
86
|
+
const baseRange = 50; // 50 meters base
|
|
87
|
+
const maxRange = 500; // 500 meters max
|
|
88
|
+
// Range scales from base to max based on linguistic
|
|
89
|
+
const range = baseRange + mulDiv(linguistic, (maxRange - baseRange), SCALE.Q);
|
|
90
|
+
return Math.round(range);
|
|
91
|
+
}
|
|
92
|
+
// ── Backward compatibility ────────────────────────────────────────────────────
|
|
93
|
+
/**
|
|
94
|
+
* Check if entity has any language capacity defined.
|
|
95
|
+
*/
|
|
96
|
+
export function hasLanguageCapacity(entity) {
|
|
97
|
+
const languages = entity.attributes.languages;
|
|
98
|
+
return languages !== undefined && languages.length > 0;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get native language (fluency >= 0.80) or highest fluency language.
|
|
102
|
+
*/
|
|
103
|
+
export function getPrimaryLanguage(entity) {
|
|
104
|
+
const languages = entity.attributes.languages;
|
|
105
|
+
if (!languages || languages.length === 0) {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
// Find native-level language first
|
|
109
|
+
const native = languages.find((l) => l.fluency_Q >= q(0.80));
|
|
110
|
+
if (native)
|
|
111
|
+
return native.languageId;
|
|
112
|
+
// Otherwise return highest fluency
|
|
113
|
+
const highest = languages.reduce((best, current) => current.fluency_Q > best.fluency_Q ? current : best);
|
|
114
|
+
return highest.languageId;
|
|
115
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { Q } from "../units.js";
|
|
2
|
+
import type { Entity } from "../sim/entity.js";
|
|
3
|
+
export interface TrackingSpec {
|
|
4
|
+
/** Seconds since quarry passed. */
|
|
5
|
+
trackAge_s: number;
|
|
6
|
+
/** Terrain type affecting track preservation. */
|
|
7
|
+
terrain: "ideal" | "rain" | "urban" | "deep_water" | "forest";
|
|
8
|
+
/** Species identifier of the quarry. */
|
|
9
|
+
quarrySpecies: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TrackingOutcome {
|
|
12
|
+
/** Confidence in track reading; above q(0.60) = reliable direction. */
|
|
13
|
+
confidence_Q: Q;
|
|
14
|
+
/** Maximum range at which entity can follow this track (metres). */
|
|
15
|
+
trackRange_m: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ForagingSpec {
|
|
18
|
+
/** Hours spent searching. */
|
|
19
|
+
searchHours: number;
|
|
20
|
+
/** Biome type affecting yield. */
|
|
21
|
+
biome: "forest" | "plains" | "desert" | "swamp" | "mountain";
|
|
22
|
+
/** Season affecting plant availability. */
|
|
23
|
+
season: "spring" | "summer" | "autumn" | "winter";
|
|
24
|
+
}
|
|
25
|
+
export interface ForagingOutcome {
|
|
26
|
+
/** Items found per hour of searching. */
|
|
27
|
+
itemsFound: number;
|
|
28
|
+
/** Quality of medicinal plants found (0–1). */
|
|
29
|
+
herbQuality_Q: Q;
|
|
30
|
+
/** True if a poisonous plant was mistaken for edible. */
|
|
31
|
+
misidentified: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface TamingSpec {
|
|
34
|
+
/** Species identifier of the animal. */
|
|
35
|
+
animalSpecies: string;
|
|
36
|
+
/** Base fear level of the animal (0 = calm, 1 = terrified). */
|
|
37
|
+
animalFearQ: Q;
|
|
38
|
+
/** Effort factor: hours spent this session (normalized: 1.0 = standard 4-hour session). */
|
|
39
|
+
effortFactor: Q;
|
|
40
|
+
/** Number of prior successful interactions with this species. */
|
|
41
|
+
priorSuccesses: number;
|
|
42
|
+
}
|
|
43
|
+
export interface TamingOutcome {
|
|
44
|
+
/** Trust level: 0 = hostile → 1 = fully tamed. */
|
|
45
|
+
trust_Q: Q;
|
|
46
|
+
/** True if animal attacked handler this session. */
|
|
47
|
+
attacked: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Resolve a tracking attempt.
|
|
51
|
+
*
|
|
52
|
+
* Formula:
|
|
53
|
+
* confidence_Q = naturalist × ageMul × terrainMul × speciesMul
|
|
54
|
+
* If quarrySpecies in entity's speciesAffinity: +q(0.15)
|
|
55
|
+
* trackRange_m = baseRange × confidence_Q (with floor at naturalist × 10m)
|
|
56
|
+
*
|
|
57
|
+
* @param entity - The tracker; uses `cognition.naturalist`.
|
|
58
|
+
* @param spec - Tracking specification.
|
|
59
|
+
* @param _seed - Reserved for future variance; currently unused.
|
|
60
|
+
*/
|
|
61
|
+
export declare function resolveTracking(entity: Entity, spec: TrackingSpec, _seed: number): TrackingOutcome;
|
|
62
|
+
/**
|
|
63
|
+
* Resolve a foraging/herbalism attempt.
|
|
64
|
+
*
|
|
65
|
+
* Formula:
|
|
66
|
+
* yield = baseYield × naturalist × seasonMul × searchHours
|
|
67
|
+
* herbQuality_Q = clamp(naturalist × randomFactor, 0, 1)
|
|
68
|
+
* P_misidentified = max(0, 0.30 − naturalist × 0.40)
|
|
69
|
+
* (troll naturalist 0.50 → ~10%; elf naturalist 0.78 → ~0%)
|
|
70
|
+
*
|
|
71
|
+
* @param entity - The forager; uses `cognition.naturalist`.
|
|
72
|
+
* @param spec - Foraging specification.
|
|
73
|
+
* @param seed - Deterministic seed for quality variance.
|
|
74
|
+
*/
|
|
75
|
+
export declare function resolveForaging(entity: Entity, spec: ForagingSpec, seed: number): ForagingOutcome;
|
|
76
|
+
/**
|
|
77
|
+
* Resolve an animal taming attempt.
|
|
78
|
+
*
|
|
79
|
+
* Formula:
|
|
80
|
+
* trust_Q = clamp(naturalist × interSpecies × effortFactor − animalFearQ × 0.50, 0, 1)
|
|
81
|
+
* attacked = RNG < (animalFearQ − trust_Q) × 0.30 (high fear + low trust = danger)
|
|
82
|
+
*
|
|
83
|
+
* Full taming (trust_Q ≥ q(0.90)) makes the animal available as an ally.
|
|
84
|
+
*
|
|
85
|
+
* @param entity - The handler; uses `cognition.naturalist` and `cognition.interSpecies`.
|
|
86
|
+
* @param spec - Taming specification.
|
|
87
|
+
* @param seed - Deterministic seed for attack check.
|
|
88
|
+
*/
|
|
89
|
+
export declare function resolveTaming(entity: Entity, spec: TamingSpec, seed: number): TamingOutcome;
|
|
90
|
+
/**
|
|
91
|
+
* Check if an animal is fully tamed (available as ally).
|
|
92
|
+
*/
|
|
93
|
+
export declare function isFullyTamed(trust_Q: Q): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Check if tracking confidence is reliable.
|
|
96
|
+
*/
|
|
97
|
+
export declare function isTrackingReliable(confidence_Q: Q): boolean;
|