-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNARSAgent.cs
More file actions
51 lines (43 loc) · 1.09 KB
/
NARSAgent.cs
File metadata and controls
51 lines (43 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Author: Christian Hahm
Created: August 10, 2022
Purpose: Script attached to NARS body. Coordinates NARS system and the body.
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NARSAgent : MonoBehaviour
{
public NARS nars;
// Start is called before the first frame update
void Start()
{
this.nars = new NARS(this);
}
// Update is called once per frame
void Update()
{
this.nars.do_working_cycle();
}
public void SendInput(Sentence input_sentence)
{
//Debug.Log("Sending input: " + this.nars.helperFunctions.sentence_to_string(input_sentence));
this.nars.global_buffer.PUT_NEW(input_sentence);
}
public void SendMotorOutput(StatementTerm operation)
{
string op = operation.get_predicate_term().ToString();
Invoke(op, 0.1f);
}
/// <summary>
/// motor op
/// </summary>
public void Operation()
{
// motor operation here
}
public int GetCurrentWorkingCycle()
{
return nars.current_cycle_number;
}
}