-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
19 lines (16 loc) · 847 Bytes
/
index.js
File metadata and controls
19 lines (16 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env node
import {DeliverooApi, timer} from "@unitn-asa/deliveroo-js-client";
import {RegisterBeliefsRevisions} from "./beliefs/beliefs.js";
import {IntentionRevision} from "./agent.js";
import {coordination} from "./coordination/coordination.js";
import {config} from "./config.js";
// Connect to the server
const client = new DeliverooApi(config.host, config.token)
client.onConnect(() => console.log("socket", client.socket.id));
client.onDisconnect(() => console.log("disconnected", client.socket.id));
client.onConfig((config) => {
// Once the connection is established
RegisterBeliefsRevisions(client); // Register the listener for the beliefs revision
IntentionRevision(client); // Register the intention revision logic
coordination(client); // Register the listener for the coordination with the other agent
})