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 their skills
 
HomeGallerySearchRegisterLog in
 

 new skill type for livingrimoire AGI software design pattern: DiSkillV2

Go down 
AuthorMessage
Moti Barski
super
super
Moti Barski

Posts : 568
Join date : 2011-08-02

new skill type for livingrimoire AGI software design pattern: DiSkillV2 Empty
PostSubject: new skill type for livingrimoire AGI software design pattern: DiSkillV2   new skill type for livingrimoire AGI software design pattern: DiSkillV2 EmptyThu Mar 25, 2021 5:36 am

java class DiSkillV2:

this is a faster cleaner to use new version of the old version

Code:
public class DiSkillV2 extends AbsCmdReq {
   protected Kokoro kokoro; // consciousness, shallow ref class to enable interskill communications
   protected DISkillUtils diSkillUtils = new DISkillUtils();
   protected Algorithm outAlg = null; // skills output

   public DiSkillV2(Kokoro kokoro) {
      super();
      this.kokoro = kokoro;
   }

   @Override
   public void input(String ear, String skin, String eye) {
   }
   @Override
   public final void output(Neuron noiron) {
      if (outAlg != null) {
         noiron.algParts.add(outAlg);
         outAlg = null;
      }
   }
}

not going to lie it is on

_________________
MB over and out emp it up
Back to top Go down
Moti Barski
super
super
Moti Barski

Posts : 568
Join date : 2011-08-02

new skill type for livingrimoire AGI software design pattern: DiSkillV2 Empty
PostSubject: Re: new skill type for livingrimoire AGI software design pattern: DiSkillV2   new skill type for livingrimoire AGI software design pattern: DiSkillV2 EmptyThu Mar 25, 2021 5:37 am

notice it also contains a class to facilitate creating algorithms which has also been updated

Code:
import java.util.ArrayList;

public class DISkillUtils {
   public Algorithm verbatimGorithm(AbsAlgPart itte) {
      // returns a simple algorithm containing 1 alg part
      String representation = "util";
      ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
      algParts1.add(itte);
      Algorithm algorithm = new Algorithm("util", representation, algParts1);
      return algorithm;
   }

   public Algorithm verbatimGorithm(String algMarker, AbsAlgPart itte) {
      // returns a simple algorithm for saying sent parameter
      String representation = "util";
      ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
      algParts1.add(itte);
      Algorithm algorithm = new Algorithm("util", representation, algParts1);
      return algorithm;
   }

   public Algorithm customizedVerbatimGorithm(String algMarker, AbsAlgPart itte) {
      // the most stable and advanced algorithm builder
      // returns a simple algorithm containing 1 alg part
      String representation = "r_" + algMarker;
      ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
      algParts1.add(itte);
      Algorithm algorithm = new Algorithm(algMarker, representation, algParts1);
      return algorithm;
   }

   public Algorithm customizedVerbatimGorithm(String algMarker, AbsAlgPart... itte) {
      // the most stable and advanced algorithm builder
      // returns a simple algorithm containing 1 alg part
      String representation = "r_" + algMarker;
      ArrayList<AbsAlgPart> algParts1 = new ArrayList<>();
      for (int i = 0; i < itte.length; i++) {
         algParts1.add(itte[i]);
      }
      Algorithm algorithm = new Algorithm(algMarker, representation, algParts1);
      return algorithm;
   }

   public String strContainsList(String str1, ArrayList<String> items) {
      // returns the 1st match between words in a string and values in a list.
      for (String temp : items) {
         if (str1.contains(temp)) {
            return temp;
         }
      }
      return "";
   }
}

_________________
MB over and out emp it up
Back to top Go down
 
new skill type for livingrimoire AGI software design pattern: DiSkillV2
Back to top 
Page 1 of 1

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