@hackbuild/agents-views 0.2.10 → 0.2.11
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/README.md +1 -1
- package/dist/yard/scope.js +15 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -176,6 +176,6 @@ Changes are in the repository [CHANGELOG](../../CHANGELOG.md). Code is MIT ([LIC
|
|
|
176
176
|
| `dist/index.js` (main entry, imports external) | 6,346 bytes | 6,663 bytes |
|
|
177
177
|
| `dist/agents-views.iife.js` (single file build) | 6,512 bytes | 6,837 bytes |
|
|
178
178
|
|
|
179
|
-
Measured 2026-
|
|
179
|
+
Measured 2026-12-02 by `node tools/lint-packages.mjs` (gzip level 9) from the packed
|
|
180
180
|
tarball. Generated from `tools/size-budget.json`; CI fails when a file moves more than
|
|
181
181
|
5 percent from its row.
|
package/dist/yard/scope.js
CHANGED
|
@@ -7,6 +7,7 @@ import * as HGAIT from '@hackbuild/gait';
|
|
|
7
7
|
import * as HTUNE from '@hackbuild/tunables';
|
|
8
8
|
import * as HSENSE from '@hackbuild/senses';
|
|
9
9
|
import * as HDRIVE from '@hackbuild/drives';
|
|
10
|
+
import { wasmBytes as DRIVES_WASM } from '@hackbuild/drives/inline';
|
|
10
11
|
import * as HCAM from '@hackbuild/cameras';
|
|
11
12
|
import * as HWEIGHT from '@hackbuild/weights';
|
|
12
13
|
import * as HBV from '@virgilvox/hackbuild-ui/vanilla';
|
|
@@ -2238,15 +2239,22 @@ Object.assign(brain, {
|
|
|
2238
2239
|
|
|
2239
2240
|
// ---- yard/dog/drives.js
|
|
2240
2241
|
// dog brain: drives. Hunger, fatigue, play, social, curiosity and prey move with the body clock and
|
|
2241
|
-
// what happens, and each tick turns them into signals for the choice.
|
|
2242
|
+
// what happens, and each tick turns them into signals for the choice. The drive, the reward of an act
|
|
2243
|
+
// and the body clock come from @hackbuild/drives (Keramati and Gutkin 2011 drive reduction; the agents
|
|
2244
|
+
// audit found the library's numbers equal the yard's own to 1.1e-15 over 3,339 states).
|
|
2245
|
+
HDRIVE.loadSync(DRIVES_WASM());
|
|
2246
|
+
const DRIVE_KEYS = ['hunger', 'fatigue', 'play', 'social', 'curiosity', 'prey'];
|
|
2247
|
+
const DRIVES = new HDRIVE.Drives({ hunger: 1, fatigue: 1, play: 0.8, social: 0.9, curiosity: 0.6, prey: 1.1 });
|
|
2248
|
+
// every deficit named, a missing one read as 0, as the yard's own sum did
|
|
2249
|
+
const fullDrives = (h) => { const o = {}; for (const k of DRIVE_KEYS) o[k] = h[k] || 0; return o; };
|
|
2250
|
+
const driveShape = () => DRIVES.setShape(TV('Br.driveN'), TV('Br.driveM'), TV('Br.gain'));
|
|
2251
|
+
ENV.dispose(() => DRIVES.free());
|
|
2242
2252
|
Object.assign(brain, {
|
|
2243
2253
|
memory(id) { const p = percepts[id]; return p && p.seen > -1e8 ? p : null; },
|
|
2244
|
-
driveD(h) {
|
|
2245
|
-
gain(K, scale = 1) {
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
return clamp(1 - (0.6 * day + 0.45 * pk - 0.22 * dip), 0, 1);
|
|
2249
|
-
},
|
|
2254
|
+
driveD(h) { driveShape(); return DRIVES.distance(fullDrives(h)); },
|
|
2255
|
+
gain(K, scale = 1) { driveShape(); DRIVES.set(fullDrives(this.d)); return DRIVES.rewardOf(K, scale); },
|
|
2256
|
+
// sleepiness from the body clock: activity peaks near 7 and 19 with a midday dip (Scientific Reports 2020)
|
|
2257
|
+
bodyClock(h) { return HDRIVE.bodyClock(h); },
|
|
2250
2258
|
tick(dt) {
|
|
2251
2259
|
const d = this.d, tempo = +$('tempo').value, org = ON('L.organic');
|
|
2252
2260
|
const moving = Math.abs(dog.v);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hackbuild/agents-views",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "Views that bind the agents packages to the hackbuild-ui class layer: the behaviour, utility and drive bars, the cues by acts associations table, the eye inset, and Yard, the dog simulator's stage and rack as one view. Each small view ships as a Vue component and as a custom element.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|