Search in sources :

Example 1 with EventEmitter

use of nars.io.events.EventEmitter in project opennars by opennars.

the class NAR method LoadFromFile.

public static NAR LoadFromFile(String name) throws FileNotFoundException, IOException, ClassNotFoundException {
    FileInputStream inStream = new FileInputStream(name);
    ObjectInputStream stream = new ObjectInputStream(inStream);
    NAR ret = (NAR) stream.readObject();
    ret.memory.event = new EventEmitter();
    ret.plugins = new ArrayList<>();
    for (Operator o : Operators.get(ret)) ret.memory.addOperator(o);
    new Plugins().init(ret);
    return ret;
}
Also used : Operator(nars.operator.Operator) EventEmitter(nars.io.events.EventEmitter) FileInputStream(java.io.FileInputStream) ObjectInputStream(java.io.ObjectInputStream)

Aggregations

FileInputStream (java.io.FileInputStream)1 ObjectInputStream (java.io.ObjectInputStream)1 EventEmitter (nars.io.events.EventEmitter)1 Operator (nars.operator.Operator)1