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


battle programming a forum for elite programmers with extreme will power to sharpen theire skills
 
HomeSearchRegisterLog in
 

 gen3 skill team work technodrum mode

Go down 
Go to page : Previous  1, 2, 3  Next
AuthorMessage
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptySat Nov 14, 2020 12:29 pm



looks like another boss battle. わくわく suru yo
Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptySun Nov 15, 2020 1:28 am




Moti Barski wrote:
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()

as I've said this is another boss battle :
the Alg class should be part of the replika super class and
have short term memory to link
the AP stem and AP items then you will get a nice perchance effect going
but with learnability.

Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptySun Nov 15, 2020 9:50 am

hmm, do I really need her to tell stories tho
Back to top Go down
Moti Barski
super
super
Moti Barski

Posts : 464
Join date : 2011-08-02

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptySun Nov 15, 2020 9:54 am

ha ?! it sounds like you are being lazy actually.
yes you need her to tell stories and have fat convos.
think about the uses : auto contents producing, and small talk

_________________
MB over and out emp it up
Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptySun Nov 15, 2020 9:57 am

ngl, I am lazy, but think about it in the very long run. would an AI need to sit
arround and watch animes and mutant movies or whatever ?
nope.
Back to top Go down
Moti Barski
super
super
Moti Barski

Posts : 464
Join date : 2011-08-02

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptySun Nov 15, 2020 10:01 am

...
won't the user get bored ?
than again people bore me. their convos bore me.
you have a point there samurai.
put the alg cls in the deprecated pile than.

_________________
MB over and out emp it up
Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyMon Nov 16, 2020 9:11 am




to do :
add replika method : recycleThreat()
summoner : AP map user annoying
Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyTue Nov 17, 2020 8:05 am

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 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")) {

      }
      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()) {

      }
      return "";
   }
}



hadouken shouryuken
Back to top Go down
Admin
Admin
Admin
Admin

Posts : 140
Join date : 2011-08-01

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyTue Nov 17, 2020 8:56 am

objpoint should be a stack

_________________
kurayami no kagi admin
Back to top Go down
http://yotamarker.forumotion.com
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyTue Nov 17, 2020 8:58 am

Code:
package chobit;

import java.util.Hashtable;
import java.util.Stack;

public class SupeReplikaMap {
   private Stack<Integer> objPoint = new Stack<Integer>();
   // private ArrayList<String> objPointGPS = new ArrayList<String>();
   private Hashtable<String, String> PointDefcon = new Hashtable<>();
   private Hashtable<String, String> objPointLog = new Hashtable<>();// sensory log
   private Compass compass = new Compass();

   /*
    * friend field //active friend used with skill if any active Mcode(item) field
    * active item being used call chobit by name : assume friend|aquire friend|temp
    * friend, visual |friend name->assert friend friendAsserted : Boolean general
    * call such as hello/hadouken : no need to assert friend
    */
   // ***algs

   public void input(String item, String defcon, String sensory) {
      // save
   }

   public void recycleThreat(String item, String defcon, String sensory) {
      // save and ignore short term memory
   }
   public void sleep() {
      // save as long term memory logs
   }

   // outputs :
   public Integer timeCost() {
      return 0;
   }

   public void getShortTermMemories() {
   }

   public String slowAlg() {
      // describe alg parts inflatedly, than move to next part
      return "";
   }

   public String answer(String question) {
      return "";
   }

   public String warning(String input) {
      return "";
   }

   public String walkThrough(String question) {
      return "";
   }

   public String shortConvo() {
      return "";
   }

   private String lieFilter() {
      return "";
   }
}
Back to top Go down
Admin
Admin
Admin
Admin

Posts : 140
Join date : 2011-08-01

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyTue Nov 17, 2020 9:22 am

short term memory should be position based

_________________
kurayami no kagi admin
Back to top Go down
http://yotamarker.forumotion.com
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyTue Nov 17, 2020 2:09 pm

Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyTue Nov 17, 2020 3:38 pm

Code:
package chobit;

import java.awt.Point;
import java.util.Hashtable;
import java.util.Stack;

public class SupeReplikaMap {
   private Stack<String> objPoint = new Stack<String>();
   // private ArrayList<String> objPointGPS = new ArrayList<String>();
   private Hashtable<String, String> pointDefcon = new Hashtable<>();
   private Hashtable<String, String> objPointLog = new Hashtable<>();// sensory log
   private Compass compass = new Compass();
   private ZeroTimeGate zeroTimeGate = new ZeroTimeGate(1);
   private Point xy = new Point(0, 0);

   /*
    * friend field //active friend used with skill if any active Mcode(item) field
    * active item being used call chobit by name : assume friend|aquire friend|temp
    * friend, visual |friend name->assert friend friendAsserted : Boolean general
    * call such as hello/hadouken : no need to assert friend
    */
   // ***algs

   // advance by compass
   // reset position to home
   public void input(String item, String defcon, String sensory) {
      // save
      if (zeroTimeGate.isClosed()) {
         zeroTimeGate.open();
         objPoint.add(xy.toString() + item);
         pointDefcon.put(xy.toString(), defcon);
         objPointLog.put(xy.toString(), sensory);
      }

   }

   public void recycleThreat(String item, String defcon, String sensory) {
      objPoint.add(xy.toString() + item);
      pointDefcon.put(xy.toString(), defcon);
      objPointLog.put(xy.toString(), sensory);
   }
   public void sleep() {
      // save as long term memory logs
   }

   // outputs :
   public Integer timeCost() {
      return 0;
   }
   public String answer(String question) {
      return "";
   }

   public String warning(String input) {
      return "";
   }

   public String walkThrough(String question) {
      return "";
   }
}
Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyTue Nov 17, 2020 10:22 pm

supereplikamap :

Code:
package chobit;

import java.awt.Point;
import java.util.Hashtable;
import java.util.Stack;

public class SupeReplikaMap {
   private Stack<String> objPoint = new Stack<String>();
   // private ArrayList<String> objPointGPS = new ArrayList<String>();
   private Hashtable<String, String> pointDefcon = new Hashtable<>();
   private Hashtable<String, String> PointLog = new Hashtable<>();// sensory log
   private Compass compass = new Compass();
   private ZeroTimeGate zeroTimeGate = new ZeroTimeGate(1);
   private Point xy = new Point(0, 0);

   /*
    * friend field //active friend used with skill if any active Mcode(item) field
    * active item being used call chobit by name : assume friend|aquire friend|temp
    * friend, visual |friend name->assert friend friendAsserted : Boolean general
    * call such as hello/hadouken : no need to assert friend
    */
   // ***algs

   // advance by compass
   // reset position to home
   public void input(String item, String defcon, String sensory) {
      // save
      if (zeroTimeGate.isClosed()) {
         zeroTimeGate.open();
         objPoint.add(xy.toString() + item);
         pointDefcon.put(xy.toString(), defcon);
         PointLog.put(xy.toString(), sensory);
      }

   }

   public void recycleThreat(String item, String defcon, String sensory) {
      // when predicting a goal, or explore traversing
      objPoint.add(xy.toString() + item);
      pointDefcon.put(xy.toString(), defcon);
      PointLog.put(xy.toString(), sensory);
   }
   public void sleep() {
      // save as long term memory logs
   }

   // outputs :
   public Integer timeCost() {
      return 0;
   }
   public String answer(String question) {
      switch (question) {
      case "describe":
         return PointLog.get(xy.toString());
      case "what":
         return pointDefcon.get(xy.toString());

      default:
         break;
      }
      return "";
   }

   public String warning(String input) {
      return "";
   }

   public String walkThrough(String question) {
      return "";
   }
}

the skill :

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 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 (this.soulOutput.isEmpty()) {
         return "";
      }
      if (ear.contains("how")) {
      }
      String question = strContains(ear, "what");
      if (!question.isEmpty()) {
      }
      question = strContains(ear, "describe", "elaborate");
      if (!question.isEmpty()) {
      }
      if (ear.contains("example")) {
         // /JOI example||detail, default for dirty skills
      }
      if (ear.contains("sleep")) {
      }
      return "";
   }
}

till your next task
Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyWed Nov 18, 2020 11:27 am

Code:
package chobit;

import java.util.ArrayList;

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;

 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 Algorithm soulOutput(String ear) // ear or time
 {
 String question = strContains(ear, "what", "description", "where", "sleep");
 switch (question) {
 case "where":
 String[] tempArray = (String[]) this.items.toArray();
 String tempItem = strContains(ear, tempArray);
 return diSkillUtil.verbatimGorithm(new APVerbatim(replikaMap.where(tempItem)));
 default:
 if (!question.isEmpty()) {
 return diSkillUtil.verbatimGorithm(new APVerbatim(replikaMap.answer(question)));
 }
 break;
 }
 return null;
 }
}

Code:
package chobit;

import java.awt.Point;
import java.util.Hashtable;
import java.util.Stack;

public class SupeReplikaMap {
   private Stack<String> objPoint = new Stack<String>();
   // private ArrayList<String> objPointGPS = new ArrayList<String>();
   private Hashtable<String, String> pointDefcon = new Hashtable<>();
   private Hashtable<String, String> PointLog = new Hashtable<>();// sensory log
   private Compass compass = new Compass();
   private ZeroTimeGate zeroTimeGate = new ZeroTimeGate(1);
   private Point xy = new Point(0, 0);
   public void input(String item, String defcon, String sensory) {
      // save
      // TODO point + compass
      if (zeroTimeGate.isClosed()) {
         zeroTimeGate.open();
         objPoint.add(xy.toString() + item);
         pointDefcon.put(xy.toString(), defcon);
         PointLog.put(xy.toString(), sensory);
      }

   }

   public void recycleThreat(String item, String defcon, String sensory) {
      // when predicting a goal, or explore traversing
      // TODO point + compass
      objPoint.add(xy.toString() + item);
      pointDefcon.put(xy.toString(), defcon);
      PointLog.put(xy.toString(), sensory);
   }
   public void sleep() {
      // save as long term memory logs
   }

   // outputs :
   public Integer timeCost() {
      return 0;
   }
   public String answer(String question) {
      switch (question) {
      case "describe":
         return PointLog.getOrDefault(xy.toString(), "hey listen");
      case "what":
         return pointDefcon.getOrDefault(xy.toString(), "hey watch out");
      default:
         break;
      }
      return "";
   }

   public String where(String item) {
      String answer = "";
      for (String temp : objPoint) {
         if (temp.contains(item)) {
            return item.replace(temp, "");
         } // TODO convert to address
      }
      return "";
   }

   public String walkThrough(String question) {
      return "";
   }
}

emp it up emp it up emp it up emp it up emp it up emp it up emp it up


Last edited by kurosen on Wed Nov 18, 2020 11:38 am; edited 1 time in total
Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyWed Nov 18, 2020 11:28 am

Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyWed Nov 18, 2020 11:59 am

Code:
package chobit;

import java.awt.Point;
import java.util.Hashtable;
import java.util.Stack;

public class SupeReplikaMap {
   private Stack<String> objPoint = new Stack<String>();
   // private ArrayList<String> objPointGPS = new ArrayList<String>();
   private Hashtable<String, String> pointDefcon = new Hashtable<>();
   private Hashtable<String, String> PointLog = new Hashtable<>();// sensory log
   private Hashtable<String, String> logPoint = new Hashtable<>();//traverse log
   private Compass compass = new Compass();
   private ZeroTimeGate zeroTimeGate = new ZeroTimeGate(1);
   private Point xy = new Point(0, 0);
   public void input(String item, String defcon, String sensory) {
      // save
      // TODO point + compass
      if (zeroTimeGate.isClosed()) {
         zeroTimeGate.open();
         objPoint.add(xy.toString() + item);
         pointDefcon.put(xy.toString(), defcon);
         PointLog.put(xy.toString(), sensory);
      }

   }

   public void recycleThreat(String item, String defcon, String sensory) {
      // when predicting a goal, or explore traversing
      // TODO point + compass
      objPoint.add(xy.toString() + item);
      pointDefcon.put(xy.toString(), defcon);
      PointLog.put(xy.toString(), sensory);
   }
   public void sleep() {
      // save as long term memory logs
   }

   // outputs :
   public Integer timeCost() {
      return 0;
   }
   public String answer(String question) {
      switch (question) {
      case "describe":
         return PointLog.getOrDefault(xy.toString(), "hey listen");
      case "what":
         return pointDefcon.getOrDefault(xy.toString(), "hey watch out");
      default:
         break;
      }
      return "";
   }

   public String where(String item) {
      String answer = "";
      for (String temp : objPoint) {
         if (temp.contains(item)) {
            return item.replace(temp, "");
         } // TODO convert to address
      }
      return "";
   }

   public String walkThrough(String question) {
      return "";
   }
   public void logPoint(String log) {
      // move point by compass
      logPoint.put(log, this.xy.toString());
   }
   public String getPoint(String log) {
      return logPoint.getOrDefault(log,"");
   }
}
Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyThu Nov 19, 2020 12:02 am

puzzle me
Back to top Go down
Admin
Admin
Admin
Admin

Posts : 140
Join date : 2011-08-01

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyThu Nov 19, 2020 12:04 am

the deacon case should have override over non cases.

_________________
kurayami no kagi admin
Back to top Go down
http://yotamarker.forumotion.com
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyThu Nov 19, 2020 12:10 am

Admin wrote:
the deacon case should have override over non cases.

pffft

Code:
public void input(String item, String defcon, String sensory) {
      // save
      // TODO point + compass
      Boolean defconOverride = (pointDefcon.getOrDefault(xy.toString(), "").isEmpty()) && !defcon.isEmpty();
      if (zeroTimeGate.isClosed() || defconOverride) {
         zeroTimeGate.open();
         objPoint.add(xy.toString() + item);
         pointDefcon.put(xy.toString(), defcon);
         PointLog.put(xy.toString(), sensory);
      }

   }

Admin likes this post

Back to top Go down
Admin
Admin
Admin
Admin

Posts : 140
Join date : 2011-08-01

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyThu Nov 19, 2020 12:11 am

maji suge

_________________
kurayami no kagi admin
Back to top Go down
http://yotamarker.forumotion.com
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyThu Nov 19, 2020 10:24 am

Code:
package chobit;

import java.awt.Point;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

// returns expression of type theRegex from the string str2Check
public class RegexUtil {
    public String regexChecker(String theRegex, String str2Check) {
        Pattern checkRegex = Pattern.compile(theRegex);
        Matcher regexMatcher = checkRegex.matcher(str2Check);
        while (regexMatcher.find()) {
            if (regexMatcher.group().length() != 0) {
                return regexMatcher.group().trim();
            }
        }
        return "";
    }

   public String numberRegex(String str2Check) {
      String theRegex = "[-+]?[0-9]{1,13}(\\.[0-9]*)?";
      ArrayList<String> list = new ArrayList<String>();
      Pattern checkRegex = Pattern.compile(theRegex);
      Matcher regexMatcher = checkRegex.matcher(str2Check);
      while (regexMatcher.find()) {
         if (regexMatcher.group().length() != 0) {
            return regexMatcher.group().trim();
         }
      }
      return "";
   }

   public String intRegex(String str2Check) {
      String theRegex = "[-+]?[0-9]{1,13}";
      ArrayList<String> list = new ArrayList<String>();
      Pattern checkRegex = Pattern.compile(theRegex);
      Matcher regexMatcher = checkRegex.matcher(str2Check);
      while (regexMatcher.find()) {
         if (regexMatcher.group().length() != 0) {
            return regexMatcher.group().trim();
         }
      }
      return "";
   }
   public Point pointRegex(String str2Check) {
      // "[-+]?[0-9]{1,13}(\\.[0-9]*)?" for double numbers
      String theRegex = "[-+]?[0-9]{1,13}";
      Point result = new Point(0, 0);
      ArrayList<String> list = new ArrayList<String>();
      Pattern checkRegex = Pattern.compile(theRegex);
      Matcher regexMatcher = checkRegex.matcher(str2Check);
      while (regexMatcher.find()) {
         if (regexMatcher.group().length() != 0) {
            result.y = Integer.parseInt(regexMatcher.group().trim());
         }
      }
      String phase2 = str2Check.replace(result.x + "", "");
      phase2 = numberRegex(phase2);
      result.x = Integer.parseInt(phase2);
      return result;
   }
   public ArrayList<String> regexChecker2(String theRegex, String str2Check) {
      // return a list of all matches
      ArrayList<String> list = new ArrayList<String>();
      Pattern checkRegex = Pattern.compile(theRegex);
      Matcher regexMatcher = checkRegex.matcher(str2Check);
      while (regexMatcher.find()) {
         if (regexMatcher.group().length() != 0) {
            list.add(regexMatcher.group().trim());
         }
      }
      return list;
   }

   public String contactRegex(String str2Check) {
      // return a list of all matches
      String theRegex = "(?<=contact)(.*)";
      ArrayList<String> list = new ArrayList<String>();
      Pattern checkRegex = Pattern.compile(theRegex);
      Matcher regexMatcher = checkRegex.matcher(str2Check);
      while (regexMatcher.find()) {
         if (regexMatcher.group().length() != 0) {
            return regexMatcher.group().trim();
         }
      }
      return "";
   }

   public String emailRegex(String str2Check) {
      // return a list of all matches
      String theRegex = "^([_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(\\.[a-zA-Z]{1,6}))?$";
      ArrayList<String> list = new ArrayList<String>();
      Pattern checkRegex = Pattern.compile(theRegex);
      Matcher regexMatcher = checkRegex.matcher(str2Check);
      while (regexMatcher.find()) {
         if (regexMatcher.group().length() != 0) {
            return regexMatcher.group().trim();
         }
      }
      return "";
   }

   public String duplicateRegex(String str2Check) {
      // return a list of all matches
      // String theRegex = "\\b(\\w+)(\\b\\W+\\b\\1\\b)*";
      String theRegex = "\\b([\\w\\s']+) \\1\\b"; // set to 1 repeat of a word like hadoken hadoken
      ArrayList<String> list = new ArrayList<String>();
      Pattern checkRegex = Pattern.compile(theRegex);
      Matcher regexMatcher = checkRegex.matcher(str2Check);
      while (regexMatcher.find()) {
         if (regexMatcher.group().length() != 0) {
            return uniqueWord(regexMatcher.group().trim());
         }
      }
      return "";
   }

   public String uniqueWord(String str) {
      ArrayList<String> list = new ArrayList<String>();
      String s[] = str.split(" ");

      String p = s[0];
      list.add(p);

      for (int i = 1; i < s.length; i++) {

         if (!(p == s[i])) {
            list.add(s[i]);
         }
         p = s[i];
      } // i

      return list.get(0);
   }
   public String afterWord(String word, String str2Check) {
      // return a list of all matches
      String theRegex = "(?<=" + word + ")(.*)";
      ArrayList<String> list = new ArrayList<String>();
      Pattern checkRegex = Pattern.compile(theRegex);
      Matcher regexMatcher = checkRegex.matcher(str2Check);
      while (regexMatcher.find()) {
         if (regexMatcher.group().length() != 0) {
            return regexMatcher.group().trim();
         }
      }
      return "";
   }

   public String phoneRegex1(String str2Check) {
      return regexChecker("[0]\\d{2}\\d{4}\\d{3}$", str2Check);
   }

   public String firstWord(String str2Check) {
      String arr[] = str2Check.split(" ", 2);
      String firstWord = arr[0]; // the
      return firstWord;
   }
}
Back to top Go down
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyThu Nov 19, 2020 1:09 pm

Back to top Go down
Admin
Admin
Admin
Admin

Posts : 140
Join date : 2011-08-01

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyFri Nov 20, 2020 10:23 am

good job samurai.
puzzle kuchiyouse no jutsu !!!

1 deleteKey() this will be used to delete failed items
2 set home coordinates functionalists
3 a save convention for transport points where the bot would ride a bus or an airplane
this will be deleted on return home.
the logic will be handled using AlgParts.

_________________
kurayami no kagi admin
Back to top Go down
http://yotamarker.forumotion.com
kurosen
codding
codding
kurosen

Posts : 273
Join date : 2012-04-17

gen3 skill team work technodrum mode - Page 2 Empty
PostSubject: Re: gen3 skill team work technodrum mode   gen3 skill team work technodrum mode - Page 2 EmptyFri Nov 20, 2020 10:53 am



Code:
package chobit;

import java.awt.Point;
import java.util.Hashtable;
import java.util.Stack;

public class SupeReplikaMap {
   private Stack<String> objPoint = new Stack<String>();
   // private ArrayList<String> objPointGPS = new ArrayList<String>();
   private Hashtable<String, String> pointDefcon = new Hashtable<>();
   private Hashtable<String, String> PointLog = new Hashtable<>();// sensory log
   private Hashtable<String, String> logPoint = new Hashtable<>();// traverse log
   private Compass compass = new Compass();
   private ZeroTimeGate zeroTimeGate = new ZeroTimeGate(1);
   private Point xy = new Point(0, 0);
   private RegexUtil regexUtil = new RegexUtil();
   public void input(String item, String defcon, String sensory) {
      // save
      // timegate pause = 1;
      zeroTimeGate.setPause(1);
      this.xy = pointUpdate(this.xy);
      Boolean defconOverride = (pointDefcon.getOrDefault(xy.toString(), "").isEmpty()) && !defcon.isEmpty();
      if (zeroTimeGate.isClosed() || defconOverride) {
         zeroTimeGate.open();
         objPoint.add(xy.toString() + item);
         pointDefcon.put(xy.toString(), defcon);
         PointLog.put(xy.toString(), sensory);
      }

   }
   public Point strToPoint(String s1) {
      return regexUtil.pointRegex(s1);
   }
   private Point pointUpdate(Point p1) {
      Point endPoint = new Point(p1.x, p1.y);
      switch (this.compass.getDirection()) {
      case 0:
         endPoint.y++;
         break;
      case 2:
         endPoint.x++;
         break;
      case 4:
         endPoint.y--;
         break;
      case 6:
         endPoint.x--;
         break;
      default:
         break;
      }
      return endPoint;
   }

   public void recycleThreat(String item, String defcon, String sensory) {
      // when predicting a goal, or explore traversing
      zeroTimeGate.setPause(5);
      objPoint.add(xy.toString() + item);
      pointDefcon.put(xy.toString(), defcon);
      PointLog.put(xy.toString(), sensory);
   }
   public void sleep() {
      // save as long term memory logs
   }

   // outputs :
   public Integer timeCost() {
      return 0;
   }
   public String answer(String question) {
      switch (question) {
      case "describe":
         return PointLog.getOrDefault(xy.toString(), "hey listen");
      case "what":
         return pointDefcon.getOrDefault(xy.toString(), "hey watch out");
      default:
         break;
      }
      return "";
   }

   public String where(String item) {
      String answer = "";
      for (String temp : objPoint) {
         if (temp.contains(item)) {
            return item.replace(temp, "");
         } // TODO convert to address
      }
      return "";
   }

   public String walkThrough(String question) {
      return "";
   }

   public void logPoint(String log) {
      // move point by compass
      logPoint.put(log, this.xy.toString());
   }

   public String getPoint(String log) {
      return logPoint.getOrDefault(log, "");
   }

   public void deleteKey(String pointItem) {
      objPoint.remove(pointItem);
      /*
       * on return home delete failed pointTransportItem.
       */
      // TODO sql side
   }

   public void setHome() {
      this.xy = new Point(0, 0);
   }
}

shinny

Admin likes this post

Back to top Go down
 
gen3 skill team work technodrum mode
Back to top 
Page 2 of 3Go to page : Previous  1, 2, 3  Next

Permissions in this forum:You cannot reply to topics in this forum
battle programmers alliance :: battle programming alliance :: chit chat-
Jump to: