#include "htm2021mag.h"
///////////////////////////////////////////////////////////////////////////////////////////////
// so just wait a bit. BUT U HAVE TO GET IT DONE TOMORROW IF ITS THAT EASY.
// get this done today.
// 1) add the proper hierarchy of verbs.
// 2) then add their modification to the scene.
// 3) add the contigency check.
// 4) add the main shell.
//https://www.youtube.com/watch?v=uvEjR1DWY5Q intelligent robotics
//
// COMPUTER VISION IMPROVEMENT
// ADD RETRACTABLE LEGS TO GO UP AND DOWN STAIRS (thats the freaky bit.)
// REDUCE THE DIRT TO SYMBOLIC LOGIC (otherwise it cant do anything with it!)
// STAYS OUT OF YOUR WAY (U GO INTO ITS SYMBOLIC MODEL)
// SUPER QUIET MOTORS
// TAKE VOICE COMMANDS
// completely all a sight job! (so its actually watching what its doing!)
// AWESOME SECURITY SYSTEM
// ATTACKS BURGULARS
//
// has secret detector to launch world domination, once ive sold enough models.
//https://www.youtube.com/watch?v=yQE9KAbFhNY <-good one!!
//theres 4096 first modifications. (alot of them dont modify the scene properly, but they all have to be there.) - and they are in a sequence of 2 -3. *3
// then theres 16 modifications, that the 4096 have to match up to. SUBSUBCHORES 4*8
// then theres 16 mods, that those 16 mods have to add up to. SUBCHORES 4*8
//
//3*10*16 = 480 tasks in front no perm missed!!!
// and that extra linear cost isnt even in it!!!!
//
// dont forget to abort the matches if they match the key early!!!! <-dynamic sequencing.
// and its the one that has the most early matches out of the exact matches is the one you pick.
// (so u can abort long ones straight away evem if they are matching!)
#define MAXSEQUENCE (16*10*10*3)
void init_htm(HTM& htm)
{
htm.tiers=4;
//so the total set of this is "do dishes"
//raw tasks
htm.tier[0].length=3; //x3 2^36
htm.tier[0].logrules=12; //i need one rule for every bit of the raw low level task key!
htm.tier[0].rules=4096; //but how many of these am i even using?!!?!?!??
//subsubsub chores
htm.tier[1].length=10; //x10 2^32
htm.tier[1].logrules=3;
htm.tier[1].rules=8;
//subsub chores
htm.tier[2].length=10; //x10 2^32
htm.tier[2].logrules=3;
htm.tier[2].rules=8;
//sub chores
htm.tier[3].length=16; //x16 2^32
htm.tier[3].logrules=2;
htm.tier[3].rules=4;
}
//looks for a grand total of -> 3*10*16 -> 480 task sequence!!! it means it can run semi offline at 8 minutes a frame, and still keep up!!!!!
// so when your making the global key, its not allowed to be more than 192 tasks, or it wont work. (so just give it a percentage complete)
// (bit of dead reckoning there.)
//
void build_symbolic_key(KEY& key) //this is the random dirty text based kitchen designer
{
//so ive run the computer vision.
//and give me a random kitchen, and i have to clean it from here.
}
void build_target_key(KEY& key, KEY& target)
{
//BUILD TARGET KEY, IS THE QUANTUM GOAL!!! (if you can write the quantum goal correct, then you can write em all!)
//this completely defys logic, so its probably true you can give yourself a valid target from now easy.
// (its getting there logically over time thats the "hard" bit.)
//so you just shift the key around, real simple like, but its just got to make sense on the final chain!!!!
}
void consistency_check(KEY& key, KEY& mod)
{
//the consistency check is the same for all tasks. but i spose its going to bring up different ones each level.
}
// so the difference of coding this and quantum, is quantum just gets one transform, and this you have all the task modifiers for all behind, and thats it.
// so see if it works, and its pretty easy to code this one too.
void run_task(KEY& key, uint task, uint level) //this is the "physics engine"
{
//what it is, is things have to be true in the sim.
//but what if something else changed and it included the water- u dont want that either.
//so u only put whats there, and its not allowed to include anything else either from before.
//THE INPUT INTO IT IS THE FINISHED ABSOLUTE SCENE!!!! maybe it ALL HAS TO BE RIGHT!!!
//before changed absolute. i actually have both of them/.
//after changed absolute.
//[ ][ ][ ][ ]
//[][][][][][][][][][][][][][][][][][][][]
//so the consistency check is the same for all tasks!!!
//AND BECAUSE ITS AN EXACT MATCH, IT MAKES IT ALOT EASIER, I ONLY NEED THE CHANGE THATS CAUSED.
/////////////////////////////////////////////////////////
//
// youve got 2 days to work it out!
//
// EASIER finish off the framework.
// EASY so give me the correct lot of task setting.
// HARDER give me the correct modification to the scene
// HARDEST tell me whats barred, and the conditional chain reactions. (but its only the 1st day, there could be better ways to do it.)
//
// if u get it done, its party time!! (but it could be looking like its working but it actually isnt, because u didnt bar it properly.)
// then finish off the physics engine, and do the best computer vision job you can!!!!
// then get it so its fully programmable with all chores, and so it takes into account
// other people, and can correlate text to its goals.
// then you should have it!!! then put the security goals in it, just keep adding programs,
// adding more computer vision elements, and well pack it like the kitchen sink with jobs!
// so what we want is a tent corner (MUCH EASIER TO GET AROUND THAN A HOUSE ON LEGS, AND JUST AS GOOD!!!!)
//
//so shes gonna have 5 levels now!!! SUBCHORES SUBSUBCHORES SUBSUBSUBCHORES. but its not that hard...
switch(level)
{
case 0:
if(1)
{
//TASKS (12 bit key)
//OBJECT(4bits)PLACE(4bits)MODIFICATION(4 bits) <-but u need to detail it more.
//ok so do these first. and then well go from here.
//so its an object and a modification. (64 each?)
//MOD_SQUEEZE 0
//MOD_CLEAN 1
//MOD_CLEANPLACE 2
//MOD_OPEN 3
//MOD_PLACE 4
//MOD_HOLDAT 5
//clean just gets rid of all the dirt instantly.
//clean place, means i actually symbols for whats there??? or i could just clean it instantly for now. but the roomba would maybe do something?
//open changes the lid state. IF ITS UPSIDE DOWN, IT POURS OUT STRAIGHT AWAY, (and u do it for all things with lids, because its just being over careful.)
//place just changes the scene insta. but. theres a few cases where possible something else happens.
//holdat, is just to soak the dish more. maybe it swishes it?
//thats actually nothing! SO MAYBE ITS GOING TO BE NOTHING!!!!
//so if you get these done, its going to be less code for the other tiers!!! (so i think.)
}
break;
case 1:
if(1)
{
//SUBSUBCHORES (so these just grant it true!) (only 3 bits!!!)
switch(task)
{
case 0: // use detergent a
//get detergent.
//open lid
//tip upside down
//squeeze, and swish with other hand, until soap is detectable.
//wait till water is filled up
//put back in place
break;
case 1: // put in plug
break;
case 2: // add water (so if water is already in there it doesnt put it in there.)
//direct spout.
//turn tap on.
break;
case 2: // turn tap off.
//turn tap off.
break;
case 3: // pull out plug (and water draining, is a chain reaction from here, its a conditional modification.)
break;
case 4: // grab dish
break;
case 5: // clean dish
//grab dish from soak in the sink (problem is it cant see it!). (is there some order it prefers? about how it does the different types?)
//make sure it has the right type of cleaner, in the other hand.
//dip the cloth?
//scrub the dirt until it comes off.
//then you wipe off the excess water.
//then you stack in its correct position. (so i need to tell them apart like this, and that could give you the ordering.)
break;
case 6: // rack dish
break;
case 7: // stack dish
//get from dirty random all over the place
//tip loose grime in bin, and maybe it brushes it off with its other hand.
//put on lowest stack position.
break;
case 8: // soak dish
//get from stack
//place in sink.
break;
}
}
break;
case 2:
if(1)
{
//so thats all it does, so its just the same in every one just about. but u have to tell me what the bars are.
//SUBCHORES (grant it true.) (2 bits!!!)
switch(task) //add soak dish to it.
{
case 0: // empty sink
//so i pull the plug out, and it put down somewhere obvious.
break;
case 1: // clean dish (and rack it)
//clean dish
break;
case 2: // fill sink&soap
//put plug in.
//add dishes to soak. //THIS WOULD ONLY CALL 1 SOAK DISH.
//use detergent
break;
case 3: // organize initial stack (one more)
//stack dish
break;
}
}
break;
case 3:
if(1)
{
//GOAL (make sure! u dont clean it too much in one hit, so get a safety percentage, or it wont get a match!!!!)
//1. do dishes
//complete PERCENTAGE_COMPLETE percent, and hopefully it makes it.
// first thing is i organize.
// then i fill the sink
// then i soak some dishes
// then i do the dishes - on the rack one at a time.
// then i empty the sink
// then i clean the bench down. (do i need symbolic dirt objects? yes u do, if you want sequences for it.)
}
break;
}
}
//runs on cigarettes!!!!
// so thats further detailed it.
void run_htm(HTM& htm) //heirarchical sequence fractal memory!!!!!
{
int i,j,k,l;
KEY dirty_kitchen;
KEY clean_kitchen;
build_symbolic_key(dirty_kitchen);
build_target_key(dirty_kitchen, clean_kitchen); //u do have to do this, but it undoes it in the framwork
KEY buildkey[MAXSEQUENCE];
uint totalsequencelength=1;
uint lastlength=1;
uint length=1;
uint skip=0;
uint skip2=0;
//get the total sequence length
for(i=htm.tiers-1;i>=0;i--){totalsequencelength*=htm.tier[i].length;}
//set the last entry as the dirty kitchen.
//set the first entry as the clean kitchen.
for(i=htm.tiers-1;i>=0;i--)
{
skip=totalsequencelength/length; //the skip of the level before
length*=htm.tier[i].length;
uint j;
for(j=0;j<totalsequencelength;j+=skip)
{
KEY startkey; //get this from j
KEY stopkey; //get this from j+skip
uint qbits=(htm.tier[i].logrules*htm.tier[i].length);
uint matchlength=htm.tier[i].length;
uint matchperm;
for(k=0;k<1<<qbits;k++)
{
for(l=0;l<matchlength;l++)
{
//access the task modifier, and modify the scene.
//run the contingency check.
//match, and if its not at matchlength, i look shorter from then onward.
}
//here you have the tasks list for this bit.
//but i only need what the key is at this point.
}
}
}
}