Record original-alignment implementation and traceability checkpoint
Capture current source, content data, tests, asset licenses, and original-specification traceability. Original implementation remains incomplete. The accepted matching UI generation passed 154 suites and 12,253 checks, with eight rendered staff-contract screens reviewed. Latest native Windows and full-original acceptance remain outstanding.
This commit is contained in:
@@ -22,6 +22,7 @@ const PATH_FAILURE_LIMIT := 3
|
||||
const STUCK_REPLAN_MINUTES := 60
|
||||
const DEFAULT_WAIT_HARD_LIMIT := 120
|
||||
const DEFAULT_EXIT_THRESHOLD := 15
|
||||
const PRIMARY_NEEDS: Array[StringName] = [&"hunger", &"sleep", &"leisure", &"intimacy"]
|
||||
|
||||
const NEED_IDS: Array[StringName] = [
|
||||
&"hunger",
|
||||
@@ -518,6 +519,7 @@ func evaluate_candidate(guest_id: StringName, candidate: Dictionary) -> Dictiona
|
||||
)
|
||||
var result := candidate.duplicate(true)
|
||||
result[&"facility_id"] = _facility_id(candidate)
|
||||
result[&"need_priority"] = _primary_need_priority(guest, candidate)
|
||||
result[&"utility"] = utility
|
||||
result[&"urgency"] = urgency
|
||||
result[&"travel_minutes"] = travel_minutes
|
||||
@@ -554,9 +556,10 @@ func select_best_candidate(
|
||||
exit_threshold: int = DEFAULT_EXIT_THRESHOLD
|
||||
) -> Dictionary:
|
||||
var ranked := rank_candidates(guest_id, candidates)
|
||||
if ranked.is_empty() or int(ranked[0][&"utility"]) < exit_threshold:
|
||||
return {}
|
||||
return ranked[0].duplicate(true)
|
||||
for candidate: Dictionary in ranked:
|
||||
if int(candidate[&"utility"]) >= exit_threshold:
|
||||
return candidate.duplicate(true)
|
||||
return {}
|
||||
|
||||
|
||||
func decide(
|
||||
@@ -574,7 +577,7 @@ func decide(
|
||||
var reserve_callback: Callable = _value(context, &"reserve_callback", Callable())
|
||||
for candidate: Dictionary in ranked:
|
||||
if int(candidate[&"utility"]) < threshold:
|
||||
break
|
||||
continue
|
||||
if reserve_callback.is_valid():
|
||||
var reservation_result: Variant = reserve_callback.call(
|
||||
guest_id,
|
||||
@@ -1203,6 +1206,8 @@ func _candidate_rejection_reason(
|
||||
) -> StringName:
|
||||
if not _candidate_need_maps_are_valid(candidate):
|
||||
return &"INVALID_NEED_MAP"
|
||||
if not bool(_value(candidate, &"inputs_available", true)):
|
||||
return &"MISSING_INPUTS"
|
||||
var adult_only := bool(_value(
|
||||
candidate,
|
||||
&"adult_only",
|
||||
@@ -1361,7 +1366,44 @@ func _candidate_urgency(guest: GuestRuntime, candidate: Dictionary) -> int:
|
||||
return result
|
||||
|
||||
|
||||
func _primary_need_priority(guest: GuestRuntime, candidate: Dictionary) -> int:
|
||||
var relief: Variant = _value(candidate, &"need_relief", {})
|
||||
if not relief is Dictionary:
|
||||
return 0
|
||||
var normalized: Dictionary = _normalized_partial_need_map(relief)
|
||||
var priority := 0
|
||||
for need: StringName in PRIMARY_NEEDS:
|
||||
if int(normalized.get(need, 0)) > 0:
|
||||
priority = maxi(priority, int(guest.needs[need]))
|
||||
return priority
|
||||
|
||||
|
||||
func get_observation(guest_id: StringName) -> Dictionary:
|
||||
var guest := get_guest(guest_id)
|
||||
if guest == null:
|
||||
return {}
|
||||
var highest := 0
|
||||
var primary: Array[StringName] = []
|
||||
for need: StringName in PRIMARY_NEEDS:
|
||||
var value := int(guest.needs[need])
|
||||
if value > highest:
|
||||
highest = value
|
||||
primary.clear()
|
||||
if value == highest and value > 0:
|
||||
primary.append(need)
|
||||
var observed_needs: Dictionary = {}
|
||||
for need: StringName in NEED_IDS:
|
||||
observed_needs[need] = guest.needs[need]
|
||||
return {&"guest_id": guest.guest_id, &"state": guest.state, &"needs": observed_needs,
|
||||
&"primary_needs": primary, &"target_facility_id": guest.target_facility_id,
|
||||
&"wallet_gold": guest.wallet_gold, &"patience": guest.patience_remaining}
|
||||
|
||||
|
||||
func _candidate_precedes(a: Dictionary, b: Dictionary) -> bool:
|
||||
var a_priority := int(a.get(&"need_priority", 0))
|
||||
var b_priority := int(b.get(&"need_priority", 0))
|
||||
if a_priority != b_priority:
|
||||
return a_priority > b_priority
|
||||
var a_utility := int(a[&"utility"])
|
||||
var b_utility := int(b[&"utility"])
|
||||
if a_utility != b_utility:
|
||||
|
||||
Reference in New Issue
Block a user