From 014dc185aae42e61cb6d0a6c3033c9cf5f45c732 Mon Sep 17 00:00:00 2001 From: olpc user Date: Tue, 10 Dec 2019 09:07:31 -0800 Subject: files not included --- starts/meaning-vm/PLAN.txt | 1 + starts/meaning-vm/habit-starts/learning-parts.cpp | 19 +++++++++++ starts/meaning-vm/habit-starts/learning-parts.hpp | 41 +++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 starts/meaning-vm/habit-starts/learning-parts.cpp create mode 100644 starts/meaning-vm/habit-starts/learning-parts.hpp (limited to 'starts/meaning-vm') diff --git a/starts/meaning-vm/PLAN.txt b/starts/meaning-vm/PLAN.txt index 3b0aa7c..cb5b46c 100644 --- a/starts/meaning-vm/PLAN.txt +++ b/starts/meaning-vm/PLAN.txt @@ -11,6 +11,7 @@ a habit that produces a descriptive structure of the last link made, outputs a log whenever you do something, redoes everything you do but with all arguments wrapped in a structure, or does the same thing as you but with a different set of inner habits. + - work with me to annotate every habit with enough information to plan around it Level 0 should be low level enough to provide for arbitrary flexibility. There shouldn't be decision-making challenges with regard to exposing diff --git a/starts/meaning-vm/habit-starts/learning-parts.cpp b/starts/meaning-vm/habit-starts/learning-parts.cpp new file mode 100644 index 0000000..eebd054 --- /dev/null +++ b/starts/meaning-vm/habit-starts/learning-parts.cpp @@ -0,0 +1,19 @@ +#include "learning-parts.hpp" + +using namespace habitstarts; +using namespace intellect::level1; + +static int __init = ([]()->int{ + + ahabit(happened-habit, + { + ref ev = ctx.get(happens); + // TODO: perform each associated event + }); + + ahabit(whenever-habit, + { + }); + + return 0; +})(); diff --git a/starts/meaning-vm/habit-starts/learning-parts.hpp b/starts/meaning-vm/habit-starts/learning-parts.hpp new file mode 100644 index 0000000..a446a1d --- /dev/null +++ b/starts/meaning-vm/habit-starts/learning-parts.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include "common.hpp" + +namespace habitstarts { + +// first need ability to trigger on stuff. +// whenever A happens, do B. +// stop doing B whenever A happens. +// when A happens, do B once. + +decl(action, happens, context); +decl(happened); // happened-habit(ctx) performs actions associated with ctx[happens] +decl(whenever); // whenever-habit(ctx) stores to do ctx[action] when ctx[happens] happens + // providing ctx[action-context] +decl(stop); decl(when); // stop-when-habit(ctx) removes doing ctx[happens] on ctx[event] +decl(once); // once-habit(ctx) stores to do ctx[action] the next time ctx[happens] happens + // providing ctx[action-context] + +/* + Testing metric: runs when event is fired, measures time between + event and right time. if [usual] time is less than ever before, success. + if time is significantly more than behavior's norm, failure. + Convert to English: try to have the event happen at the right time. +*/ +// starting out by making a judgement habit that occasionally provides 'good' or 'bad' to things, to lead how to develop + // for fairness, seems reasonable to provide a pattern showing reason for good or bad +// + +// set to do 1ce at goal time: +// ctx X +// set to do 1ce on goal time: +// set next-happened (local) +// delay (a sequence of habits that do nothing) +// if next-happened is set +// remove something from delay +// otherwise +// add something to delay (wait for unspecified user-perceptible time, selected from discrete set) +// provide adjusted delay to next context + +} -- cgit v1.2.3