Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# -*- coding: utf-8 -*-
import libs.lif as lf
key = "question"
value = self.context['question']
theta = self.get_theta(all_float=False, key=key, value=value)
Lif = lf.Lif(theta, x0=self.context['x0'], A=1.4 , T=100, gamma=.004, omega=.8, lifversion=2)
suggestion = Lif.suggest()
self.action["x"] = suggestion["x"]
self.action["t"] = suggestion["t"]
self.set_theta(Lif, key=key, value=value)
import time
"type" : "getadvice",
"t" : suggestion["t"],
"x" : suggestion["x"],
"time" : int(time.time()),
"context" : self.context,
"q" : self.context['question']
# Example URL
# /2/getAction.json?key=69cd74c53&context={"question":2,"x0"=:1.0}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment