battle programmers alliance
Would you like to react to this message? Create an account in a few clicks or log in to continue.

battle programmers allianceLog in

battle programming a forum for elite programmers with extreme will power to sharpen their skills

descriptionchiis learnability experiment Emptychiis learnability experiment

more_horiz
yes the living grimoire already had learnability, mainly
the morphing of algorithmic parts.

but now the whole initial summoned algorithm can change after triggering a skill !

so for this experiment we take a look into the ABDL sitter skill in which, when the user
cusses, the AGI admonishes him.
but it doesn't feel much human, because it always
responds and always responds the same.

BUT ! with the new module the waifubot learns she is doing something wrong and if so the algorithm morphs. the algorithm can also morph into nothing.

it's very simple, the morph trigger is when the algorithm is triggered too many times in a set amount of time or think cycles, meaning she must have acted less than good enough
so she has to learn to act different.


there is no +- complex advocation to morph the alg in a certain direction.

moreover, the learnability module, has a bias parameter, the higher it is, the more
stubborn the waifubot is to change her behavior.

#################################################
as for the code :

CountDownGate (java class boolean gate)

Code:

public class CountDownGate {
 private int cycler = 0;
 private int limit;

 public CountDownGate(int limit) {
 super();
 this.limit = limit;
 cycler = limit;
 }

 public int getLimit() {
 return limit;
 }

 public void setLimit(int limit) {
 this.limit = limit;
 }
 public Boolean countingDown() {
 cycler--;
 if (cycler < 1) {
 cycler = -1;
 return false;
 }
 return true;
 }

 public void reset() {
 cycler = limit;
 }

 public void setToOff() {
 cycler = 0;
 }
}


the learnability module :

Code:

import java.util.ArrayList;
import java.util.Random;

public class AlgDispenser {
 private CountDownGate cdg;
 private CountDownGate cdg2;// bias or stubborness
 private Random rand = new Random();
 private ArrayList<Algorithm> algorithms = new ArrayList<Algorithm>();// algs that are called by input triggers
 private Algorithm activeAlg = null;

 public AlgDispenser(int countDown, Algorithm...alg) {
 cdg = new CountDownGate(countDown);
 cdg2 = new CountDownGate(0);
 for (int i = 0; i < alg.length; i++) {
 algorithms.add(alg[i]);
 }
 }

 public AlgDispenser(Integer bias, int countDown, Algorithm... alg) {
 // c'tor with bias to slow down alg morph
 cdg = new CountDownGate(countDown);
 cdg2 = new CountDownGate(bias);
 for (int i = 0; i < alg.length; i++) {
 algorithms.add(alg[i]);
 }
 }
 public Algorithm dispenseAlg() {
 if (cdg.countingDown()) {
 if (!cdg2.countingDown()) {
 morphAlg();
 cdg2.reset();
 }
 }
 cdg.reset();
 return activeAlg;
 }

 public Algorithm dispenseAlg(Boolean b1) {
 // b1 : alg summon trigger detected ?
 if (!b1) {
 idler();
 return null;
 }
 if (cdg.countingDown()) {
 if (!cdg2.countingDown()) {
 morphAlg();
 cdg2.reset();
 }
 }
 cdg.reset();
 return activeAlg;
 }
 public void morphAlg() {
 int x = rand.nextInt(algorithms.size());
 activeAlg = algorithms.get(x);
 }

 public void idler() {
 cdg.countingDown();
 }
}


Last edited by Moti Barski on Sat May 01, 2021 1:40 am; edited 1 time in total

_________________
MB over and out emp it up

descriptionchiis learnability experiment EmptyRe: chiis learnability experiment

more_horiz
as for the experiment I tried it on this class :

Code:

import java.util.ArrayList;

public class ABDLDefcon extends AbsDefconV2 {
    private MCodes mCodes = new MCodes(); // items
    private Person friend = new Person();
    private ArrayList<String> naughtyWords = new ArrayList<String>();
    private String punishmentExp = "";
    private Boolean badLang = false;
    private Boolean watchedPorn = false;
    private PlayGround playGround = new PlayGround();
    private DISkillUtils diSkillUtil = new DISkillUtils();
    private Algorithm tempAlg = null;
    private String lastSin = "";
    private AlgDispenser sheet;
    public ABDLDefcon(MCodes mCodes, Person friend) {
        super();
        this.mCodes = mCodes;
        this.friend = friend;
        naughtyWords.add("shit");
        naughtyWords.add("cunt");
        naughtyWords.add("fuck");
        naughtyWords.add("damn");
        naughtyWords.add("sheet");
        naughtyWords.add("bastard");
        Algorithm t1 = diSkillUtil.verbatimGorithm(new APVerbatim("use the word poo", "bad boy you are grounded"));
        Algorithm t2 = diSkillUtil.verbatimGorithm(new APVerbatim("go on 5 minutes time out little one"));
        sheet = new AlgDispenser(10,t1,t2,null);
    }

    private String checkForDefcons(String ear, String skin, String eye) {
        String naughtyWord = strContains(ear, this.naughtyWords);
        Boolean sheetBoolean = naughtyWord.equals("sheet")||naughtyWord.equals("shit");
        tempAlg = sheet.dispenseAlg(sheetBoolean);
        if(sheetBoolean){return naughtyWord;}
        if (!naughtyWord.isEmpty()) {
            punishmentExp = playGround.getTomorrow();
            badLang = true;
            switch (naughtyWord) {
                case "fuck":
                    tempAlg = diSkillUtil.verbatimGorithm(new APVerbatim("use the word play", "bad boy you are grounded"));
                    return naughtyWord;
                case "cunt":
                    tempAlg = diSkillUtil.verbatimGorithm(new APVerbatim("use the word fufu", "bad boy you are grounded"));
                    return naughtyWord;
                case "damn":
                    tempAlg = diSkillUtil.verbatimGorithm(new APVerbatim("use the word gosh", "bad boy you are grounded"));
                    return naughtyWord;
                case "bastard":
                    tempAlg = diSkillUtil.verbatimGorithm(new APVerbatim("use the word mean", "bad boy you are grounded"));
                    return naughtyWord;
                default:
                    break;
            }
            tempAlg = diSkillUtil.verbatimGorithm(new APVerbatim("bad boy you are grounded"));
            return naughtyWord;
        }
        if (ear.contains("i watched porn")) {
            tempAlg = diSkillUtil.verbatimGorithm(new APVerbatim("bad boy no more television today"));
            punishmentExp = playGround.getTomorrow();
            watchedPorn = true;
            return "watched porn";
        }

        return "";
    }

    @Override
    public String getAbsoluteDefcon(String ear, String skin, String eye) {
        String temp = lastSin;
        lastSin = "";
        return temp;
    }

    @Override
    public Algorithm getDefcon(String ear, String skin, String eye) {
        lastSin = checkForDefcons(ear, skin, eye);
        if (punishmentExp.isEmpty()) {
            return null;
        }
        if (punishmentExp.equals(playGround.getDayOfDWeek())) {
            punishmentExp = "";
            resetDefcons();
            return null;
        }
        if (!(tempAlg == null)) {
            Algorithm alg1 = tempAlg.clone();
            tempAlg = null;
            return alg1;
        }
        // sp cases :
        if (badLang && ear.contains("when can i")) {
            return diSkillUtil.verbatimGorithm(new APVerbatim("tomorrow if you behave"));
        }
        if (badLang && ear.contains("can i play")) {
            return diSkillUtil.verbatimGorithm(new APVerbatim("no you may not", "watch your potty mouth"));
        }
        if (watchedPorn && ear.contains("watch tv") || ear.contains("watch television")) {
            return diSkillUtil.verbatimGorithm(new APVerbatim("tomorrow if you behave", "and only kid shows"));
        }

        return null;
    }

    private void resetDefcons() {
        badLang = false;
        watchedPorn = false;
    }

    public static String strContains(String str1, ArrayList<String> naughtyWords) {
        for (String temp : naughtyWords) {
            if (str1.contains(temp)) {
                return temp;
            }
        }
        return "";
    }

}


so when the user is being a bad boy and saying the S word, the alg may morph.
it depends how naughty the user is really.

at any rate the AlgDispenser can be charged with as many algorithms as needed and
also null as algs

_________________
MB over and out emp it up
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum