gen3 skill team work technodrum mode
Author Message Moti Barski superPosts : 498Join date : 2011-08-02 Subject: gen3 skill team work technodrum mode Thu Nov 12, 2020 1:23 am @kurosen hadouken
_________________
MB over and out
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 1:24 am VIDEO here we go defcon input otheroutput{ //skill default trg input,timer, prophesy} souloutput
Moti Barski superPosts : 498Join date : 2011-08-02 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 1:34 am {defcon, soulInput} : if null alg return; other{} if null alg return;//*3 + 1 souloutput{}
_________________
MB over and out
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 1:50 am also need to reset the alg to null at the start of the input stage
Moti Barski superPosts : 498Join date : 2011-08-02 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 1:51 am kurosen wrote: also need to reset the alg to null at the start of the input stage yeah, I see it
_________________
MB over and out
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 1:52 am Code: package chobit; import java.util.ArrayList; import java.util.PriorityQueue; import java.util.Queue; public class TheSkill extends DISkill { protected RegexUtil regexUtil = new RegexUtil(); protected DISkillUtils diSkillUtil = new DISkillUtils(); protected PlayGround playGround = new PlayGround(); protected CloudianV2 cloudian = new CloudianV2(); private MCodes mCodes = new MCodes(); // items private ReplikaMap replikaMap = new ReplikaMap(); private Person friend = new Person(); // if you deal with several friends handle it in the sub class private Boolean friendUpdatable = false; private ArrayList<String> items = new ArrayList<String>(); private String item = ""; protected AbsDefConTranslator absDefConTranslator; private int defcon = 0; protected Algorithm outputAlg = null; protected Queue<String> soulOutput = new PriorityQueue<>(); private int soulHP = 2; private Boolean replenishSoulHp = true; public TheSkill(Kokoro kokoro, AbsDefConTranslator absDefConTranslator, ArrayList<String> items) { super(kokoro); this.items = items; this.absDefConTranslator = absDefConTranslator; } @Override public void input(String ear, String skin, String eye) { detectFriend(ear); } @Override public void output(Neuron noiron) { if (!isNull(this.outputAlg)) { noiron.algParts.add(this.outputAlg); this.outputAlg = null; } // after this, if there is no reference to the object, // it will be deleted by the garbage collector } private boolean isNull(Object obj) { return obj == null; } private void trgAction(String ear, String skin, String eye) { // sensory, souled, predicted } private void trgExplore(String ear, String skin, String eye) { // timed // Exploration and learning, Alg efficiancy tests and sort } private void trgPreserve(String ear, String skin, String eye) { // timed // items and persons preservation, causes being annoyed if repeated in day } protected Algorithm makeFriend() { return diSkillUtil.verbatimGorithm(new APVerbatim("what is your name")); } protected void friendUpdate(String ear) { String temp = regexUtil.phoneRegex1(ear); if(!temp.isEmpty()) {friend.setPhone(temp);} temp = regexUtil.emailRegex(ear); if(!temp.isEmpty()) {friend.setEmail(temp);} temp = regexUtil.afterWord("i am ", ear); if (temp.isEmpty()) { temp = regexUtil.afterWord("my name is ", ear); } if (!temp.isEmpty()) { friend.setName(temp); friend.setActive(true); } temp = regexUtil.duplicateRegex(ear); if (!temp.isEmpty()) { friend.setJutsu(temp); friend.setActive(true); } } // key stuff detection and handling protected void detectFriend(String ear) { if (playGround.getMinutesAsInt() % 2 == 0) { friendUpdatable = false; } Boolean friendRequest = (ear.contains("friends") || ear.contains("my name is")) && !this.friend.getActive(); if (friendRequest) { kokoro.toHeart.put("Me", "introduce"); } if (ear.contains(friend.getName()) || (ear.contains(friend.getJutsu())) || friendRequest)// or friend visual { friendUpdatable = true; } if (friendUpdatable) { friendUpdate(ear); } } protected String currentItem(String ear, String skin, String eye) { for (String item : items) { if (eye.contains(item)) { return item; } } for (String item : items) { if (skin.contains(item)) { return item; } } for (String item : items) { if (ear.contains(item)) { return item; } } return ""; } public static String strContains(String str1, String... a) { for (String temp : a) { if (str1.contains(temp)) { return temp; } } return ""; } protected void inputToSoul(String ear, String skin, String eye) { String sensory = ear; if (sensory.isEmpty()) { sensory = skin; } if (sensory.isEmpty()) { sensory = eye; } if (!this.item.isEmpty()) { this.replikaMap.input(item, defcon, sensory); } } protected String soulOutput(String ear) // ear or time { if (ear.contains("yes")) { soulHP++; } if (this.soulOutput.isEmpty()) { return ""; } if (ear.contains("how")) { } String question = strContains(ear, "who", "what", "when", "where", "why", "which"); if (!question.isEmpty()) { } if (ear.contains("example")) { // /JOI example||detail, default for dirty skills } if (ear.contains("sleep")) { } if (ear.contains("story")) { // time trg } // default : imprint fresh memories, check not in friend memory. if (!this.soulOutput.isEmpty()) { soulHP--; } replenishSoulHP(); return ""; } private void replenishSoulHP() { int tempMinute = playGround.getMinutesAsInt(); if (tempMinute != 1) { replenishSoulHp = true; return; } if ((tempMinute == 1) && replenishSoulHp) { soulHP = 2; replenishSoulHp = false; } } protected Algorithm mainOutput() { // overridde me return null; } }
this is the b4
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 1:55 am Code: package chobit; import java.util.Calendar; import java.util.Date; public class ZeroTimeGate { // a gate that only opens x minutes after it has been set private int pause = 1; private Date openedGate = new Date(); private Date checkPoint = new Date(); public ZeroTimeGate(int minutes) { super(); this.pause = minutes; try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block // e.printStackTrace(); } } public ZeroTimeGate() { } public Boolean isClosed() { return openedGate.before(new Date()); } public void open() { this.openedGate = addMinutesToJavaUtilDate(new Date(), pause); } public void open(int minutes) { Date now = new Date(); openedGate = addMinutesToJavaUtilDate(now, minutes); } private Date addMinutesToJavaUtilDate(Date date, int minutes) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.MINUTE, minutes); return calendar.getTime(); } public void setPause(int pause) { if (pause < 60 && pause > 0) { this.pause = pause; } } public void resetCheckPoint() { this.checkPoint = new Date(); } public int givenTwoDateTimesInJava8_whenDifferentiatingInSeconds_thenWeGetTen() { Date now = new Date(); long diff = now.getTime() - this.checkPoint.getTime(); long diffSeconds = diff / 1000 % 60; // long diffMinutes = diff / (60 * 1000) % 60; // long diffHours = diff / (60 * 60 * 1000) % 24; // long diffDays = diff / (24 * 60 * 60 * 1000); // System.out.print(diffDays + " days, "); // System.out.print(diffHours + " hours, "); // System.out.print(diffMinutes + " minutes, "); // System.out.print(diffSeconds + " seconds."); return (int) diffSeconds; } }
I updated the zerotimegate
Moti Barski superPosts : 498Join date : 2011-08-02 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 1:56 am an anti glitch in the c'tor ha ? based
_________________
MB over and out
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 1:57 am lets continue tomorow, I'm pretty tired tbh
Moti Barski likes this post
Like 1 Dislike
Moti Barski superPosts : 498Join date : 2011-08-02 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 1:57 am kurosen wrote: lets continue tomorow, I'm pretty tired tbh no problem.
haha we have a like ban cool
_________________
MB over and out
Moti Barski superPosts : 498Join date : 2011-08-02 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 11:09 am you there? post focus on the input meth
_________________
MB over and out
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 11:11 am Code: public void input(String ear, String skin, String eye) { detectFriend(ear); this.outputAlg = this.absDefConTranslator.getDefcon(ear, skin, eye); }
Moti Barski superPosts : 498Join date : 2011-08-02 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 11:15 am lets take a look into the replica input \we can thin it out I think
_________________
MB over and out
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 11:43 am mod for superreplikamap :
Code: public void input(String item, String defcon, String sensory) { // save }
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Thu Nov 12, 2020 12:20 pm Code: protected void inputToSoul(String ear, String skin, String eye) { String sensory = ear; String currentDefcon = this.absDefConTranslator.getDefconTranslator().getSpecificDefcom(ear, skin, eye); if (currentDefcon.isEmpty()) { currentDefcon = absDefConTranslator.getDefconTranslator().aquiredTarget(); } if (sensory.isEmpty()) { sensory = skin; } if (sensory.isEmpty()) { sensory = eye; } if (!this.item.isEmpty()) { this.replikaMap.input(item, currentDefcon, sensory); } }
Moti Barski superPosts : 498Join date : 2011-08-02 Subject: Re: gen3 skill team work technodrum mode Fri Nov 13, 2020 9:50 am VIDEO lets go samurai. populate the input function
_________________
MB over and out
kurosen coddingPosts : 291Join date : 2012-04-17 kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Fri Nov 13, 2020 9:58 am Code: @Override public void input(String ear, String skin, String eye) { detectFriend(ear); //func1 : this.outputAlg = this.absDefConTranslator.getDefcon(ear, skin, eye); inputToSoul(ear, skin, eye); if(outputAlg!=null) {return;} //func2 triggeredAlgs(ear,skin,eye); if(isNull(outputAlg)) {return;} } private void triggeredAlgs(String ear, String skin, String eye) { trgAction(ear,skin,eye); if(isNull(outputAlg)) {return;} trgExplore(ear, skin, eye); if(isNull(outputAlg)) {return;} trgPreserve(ear, skin, eye); }
I need you to feel in the triggeredAlgs comments
Moti Barski superPosts : 498Join date : 2011-08-02 Subject: Re: gen3 skill team work technodrum mode Fri Nov 13, 2020 10:02 am finish the framework func 1st
_________________
MB over and out
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Fri Nov 13, 2020 10:05 am Moti Barski wrote: finish the framework func 1st Code: @Override public void input(String ear, String skin, String eye) { detectFriend(ear); // func1 : this.outputAlg = this.absDefConTranslator.getDefcon(ear, skin, eye); inputToSoul(ear, skin, eye); if (outputAlg != null) { return; } // func2 triggeredAlgs(ear, skin, eye); if (isNull(outputAlg)) { return; } // func3 soulOutput(ear); }
this belongs in the louver museum tbh
Moti Barski likes this post
Like 1 Dislike
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Fri Nov 13, 2020 1:03 pm Code: package chobit; import java.util.ArrayList; import java.util.PriorityQueue; import java.util.Queue; public abstract class TheSkill extends DISkill { protected RegexUtil regexUtil = new RegexUtil(); protected DISkillUtils diSkillUtil = new DISkillUtils(); protected PlayGround playGround = new PlayGround(); protected CloudianV2 cloudian = new CloudianV2(); private MCodes mCodes = new MCodes(); // items private ReplikaMap replikaMap = new ReplikaMap(); private Person friend = new Person(); // if you deal with several friends handle it in the sub class private Boolean friendUpdatable = false; private ArrayList<String> items = new ArrayList<String>(); private String item = ""; protected AbsDefConTranslator absDefConTranslator; private int defcon = 0; protected Algorithm outputAlg = null; protected Queue<String> soulOutput = new PriorityQueue<>(); private int soulHP = 2; private Boolean replenishSoulHp = true; public TheSkill(Kokoro kokoro, AbsDefConTranslator absDefConTranslator, ArrayList<String> items) { super(kokoro); this.items = items; this.absDefConTranslator = absDefConTranslator; } @Override public void input(String ear, String skin, String eye) { detectFriend(ear); // func1 : this.outputAlg = this.absDefConTranslator.getDefcon(ear, skin, eye); inputToSoul(ear, skin, eye); if (outputAlg != null) { return; } // func2 triggeredAlgs(ear, skin, eye); if (isNull(outputAlg)) { return; } // func3 soulOutput(ear); } private void triggeredAlgs(String ear, String skin, String eye) { trgAction(ear, skin, eye); if (isNull(outputAlg)) { return; } trgExplore(ear, skin, eye); if (isNull(outputAlg)) { return; } trgPreserve(ear, skin, eye); } @Override public void output(Neuron noiron) { if (!isNull(this.outputAlg)) { noiron.algParts.add(this.outputAlg); this.outputAlg = null; } // after this, if there is no reference to the object, // it will be deleted by the garbage collector } private boolean isNull(Object obj) { return obj == null; } protected abstract void trgAction(String ear, String skin, String eye); // sensory, souled(kokoro cls directives), predicted protected abstract void trgExplore(String ear, String skin, String eye); // timed // Exploration and learning, Alg efficiancy tests and sort protected abstract void trgPreserve(String ear, String skin, String eye); // timed // items and persons preservation, causes being annoyed if repeated in day protected Algorithm makeFriend() { return diSkillUtil.verbatimGorithm(new APVerbatim("what is your name")); } protected void friendUpdate(String ear) { String temp = regexUtil.phoneRegex1(ear); if(!temp.isEmpty()) {friend.setPhone(temp);} temp = regexUtil.emailRegex(ear); if(!temp.isEmpty()) {friend.setEmail(temp);} temp = regexUtil.afterWord("i am ", ear); if (temp.isEmpty()) { temp = regexUtil.afterWord("my name is ", ear); } if (!temp.isEmpty()) { friend.setName(temp); friend.setActive(true); } temp = regexUtil.duplicateRegex(ear); if (!temp.isEmpty()) { friend.setJutsu(temp); friend.setActive(true); } } // key stuff detection and handling protected void detectFriend(String ear) { if (playGround.getMinutesAsInt() % 2 == 0) { friendUpdatable = false; } Boolean friendRequest = (ear.contains("friends") || ear.contains("my name is")) && !this.friend.getActive(); if (friendRequest) { kokoro.toHeart.put("Me", "introduce"); } if (ear.contains(friend.getName()) || (ear.contains(friend.getJutsu())) || friendRequest)// or friend visual { friendUpdatable = true; } if (friendUpdatable) { friendUpdate(ear); } } protected String currentItem(String ear, String skin, String eye) { for (String item : items) { if (eye.contains(item)) { return item; } } for (String item : items) { if (skin.contains(item)) { return item; } } for (String item : items) { if (ear.contains(item)) { return item; } } return ""; } public static String strContains(String str1, String... a) { for (String temp : a) { if (str1.contains(temp)) { return temp; } } return ""; } protected void inputToSoul(String ear, String skin, String eye) { String sensory = ear; String currentDefcon = this.absDefConTranslator.getDefconTranslator().getSpecificDefcom(ear, skin, eye); if (currentDefcon.isEmpty()) { currentDefcon = absDefConTranslator.getDefconTranslator().aquiredTarget(); } if (sensory.isEmpty()) { sensory = skin; } if (sensory.isEmpty()) { sensory = eye; } if (!this.item.isEmpty()) { this.replikaMap.input(item, currentDefcon, sensory); } } protected String soulOutput(String ear) // ear or time { if (ear.contains("yes")) { soulHP++; } if (this.soulOutput.isEmpty()) { return ""; } if (ear.contains("how")) { } String question = strContains(ear, "who", "what", "when", "where", "why", "which"); if (!question.isEmpty()) { } if (ear.contains("example")) { // /JOI example||detail, default for dirty skills } if (ear.contains("sleep")) { } if (ear.contains("story")) { // time trg } // default : imprint fresh memories, check not in friend memory. if (!this.soulOutput.isEmpty()) { soulHP--; } replenishSoulHP(); return ""; } private void replenishSoulHP() { int tempMinute = playGround.getMinutesAsInt(); if (tempMinute != 1) { replenishSoulHp = true; return; } if ((tempMinute == 1) && replenishSoulHp) { soulHP = 2; replenishSoulHp = false; } } protected Algorithm mainOutput() { // overridde me return null; } }
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Sat Nov 14, 2020 1:08 am unit testing successful : defcontranslator cls :
Code: package chobit; import java.util.ArrayList; import java.util.Stack; public class DefconTranslator { private String input = ""; private Stack<String> inputStack = new Stack<String>(); private ArrayList<String> extraDefcons = new ArrayList<String>();// extra defcons private ZeroTimeGate zeroTimeGate = new ZeroTimeGate(1); private RegexUtil regexUtil = new RegexUtil(); private String target = ""; public DefconTranslator(ArrayList<String> extraDefcons) { super(); this.extraDefcons = extraDefcons; } public String getSpecificDefcom(String ear, String skin, String eye) { for (String item : extraDefcons) { if (eye.contains(item)) { return item; } } for (String item : extraDefcons) { if (skin.contains(item)) { return item; } } for (String item : extraDefcons) { if (ear.contains(item)) { return item; } } return ""; } public String aquiredTarget() { // for (String item : inputStack) { // if (eye.contains(item)) { // return item; // } // } // for (String item : inputStack) { // if (skin.contains(item)) { // return item; // } // } // for (String item : inputStack) { // if (ear.contains(item)) { // return item; // } // } return target; } // get unique defcon public int getDefcon(String ear, String skin, String eye) { // override this methode in subclass per skill this.target = ""; if (zeroTimeGate.isClosed()) { if (listInStrEye(ear, skin, eye)) { zeroTimeGate.open(); target = regexUtil.firstWord(eye); inputStack.push(target); return 1; } if (listInStrEar(ear, skin, eye)) { zeroTimeGate.open(); target = regexUtil.afterWord("it is", ear); if (!target.isEmpty()) { inputStack.push(target); } return 2; } if (listInStrLearnedEar(ear, skin, eye)) { zeroTimeGate.open(); // set target from regex // send alg // stuck clear;return alg target = "deduced: " + regexUtil.afterWord("it is", ear); if (target.isEmpty()) { return 3; } inputStack.clear(); } if (listInStrLearnedEye(ear, skin, eye)) { zeroTimeGate.open(); target = "deduced: " + regexUtil.firstWord(eye); inputStack.clear(); return 4; // set target from regex // send alg // stuck clear;return alg } } return 0; } private Boolean listInStrEye(String ear, String skin, String eye) { for (String string : extraDefcons) { if (skin.contains(string)) { return true; } } for (String string : extraDefcons) { if (eye.contains(string)) { return true; } } return false; } private Boolean listInStrEar(String ear, String skin, String eye) { for (String string : extraDefcons) { if (ear.contains(string)) { return true; } } return false; } private Boolean listInStrLearnedEar(String ear, String skin, String eye) { for (String string : inputStack) { if (ear.contains(string)) { return true; } } return false; } private Boolean listInStrLearnedEye(String ear, String skin, String eye) { for (String string : inputStack) { if (eye.contains(string)) { return true; } } return false; } }
kurosen coddingPosts : 291Join date : 2012-04-17 Subject: Re: gen3 skill team work technodrum mode Sat Nov 14, 2020 10:07 am VIDEO should dive into the replika. what do you think ?
Moti Barski superPosts : 498Join date : 2011-08-02 Subject: Re: gen3 skill team work technodrum mode Sat Nov 14, 2020 11:45 am ok, here is what I need next : the replica side of the input() souloutput : alg selection, the replica side of the soul output item preservation, and befriending should be handled in the override the skill subclasses so no problem there. a comment should suffice.
_________________
MB over and out
Moti Barski superPosts : 498Join date : 2011-08-02 Subject: Re: gen3 skill team work technodrum mode Sat Nov 14, 2020 12:26 pm Alg cls: AlgPart action var : default or learned or chooses to know if the ap uses an item we can use a naming convention, the ap has item name. with the exception of special AP like saying and cussing which we can hardcode. the super replica also needs a position reset()
_________________
MB over and out
gen3 skill team work technodrum mode
Permissions in this forum: You cannot reply to topics in this forum
February 2021 Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Calendar