👨‍💻 dev AXskillBundle

development

owly

闇の伝説
Staff member
戦闘 コーダー
Java:
public class SkillHubAlgDispenser {
    private ArrayList<DiSkillV2> skills = new ArrayList<DiSkillV2>();
    private int activeSkill = 0;
    private Neuron tempN = new Neuron();;
    private Random rand = new Random();
    public SkillHubAlgDispenser(DiSkillV2...skillsParams) {
        for (DiSkillV2 skill : skillsParams)
        {
            skills.add(skill);
        }
    }
    public SkillHubAlgDispenser addSkill(DiSkillV2 skill){
        // builder pattern
        skills.add(skill);
        return this;
    }
    public Algorithm dispenseAlgorithm(String ear, String skin, String eye){
        // return value to outAlg param of (external) summoner DiskillV2
        skills.get(activeSkill).input(ear,skin,eye);
        skills.get(activeSkill).output(tempN);
        for (int i = 1; i < 6; i++) {
            Algorithm temp = tempN.getAlg(i);
            if (temp != null){
                return temp;
            }
        }
        return null;
    }
    public void randomizeActiveSkill(){
        activeSkill = rand.nextInt(skills.size());
    }
    public void setActiveSkillWithMood(int mood){
        // mood integer represents active skill
        // different mood = different behavior
        if ((mood>-1) && mood < (skills.size())){
            activeSkill = mood;
        }
    }
    public void cycleActiveSkill(){
        // changes active skill
        // I recommend this method be triggered with a Learnability or SpiderSense object
        activeSkill++;
        if (activeSkill == skills.size()){
            activeSkill = 0;
        }
    }
    public int getSize(){return skills.size();}
}
that's the template we start with
 

fukurou

the supreme coder
ADMIN
Java:
public class AXSkillBundle {
    private ArrayList<DiSkillV2> skills = new ArrayList<DiSkillV2>();
    private Neuron tempN = new Neuron();;
    public AXSkillBundle(DiSkillV2...skillsParams) {
        for (DiSkillV2 skill : skillsParams)
        {
            skills.add(skill);
        }
    }
    public AXSkillBundle addSkill(DiSkillV2 skill){
        // builder pattern
        skills.add(skill);
        return this;
    }
    public Algorithm dispenseAlgorithm(String ear, String skin, String eye){
        for (DiSkillV2 skill : skills) {
            skill.input(ear, skin, eye);
            skill.output(tempN);
            for (int j = 1; j < 6; j++) {
                Algorithm temp = tempN.getAlg(j);
                if (temp != null) {
                    return temp;
                }
            }
        }
        return null;
    }
    public int getSize(){return skills.size();}
}

tuple code would make shit interesting. solid shit
 

fukurou

the supreme coder
ADMIN
Java:
public class AXSkillBundle {
    private ArrayList<DiSkillV2> skills = new ArrayList<DiSkillV2>();
    private Neuron tempN = new Neuron();;
    public AXSkillBundle(DiSkillV2...skillsParams) {
        for (DiSkillV2 skill : skillsParams)
        {
            skills.add(skill);
        }
    }
    public AXSkillBundle addSkill(DiSkillV2 skill){
        // builder pattern
        skills.add(skill);
        return this;
    }
    public AlgorithmV2 dispenseAlgorithm(String ear, String skin, String eye){
        for (DiSkillV2 skill : skills) {
            skill.input(ear, skin, eye);
            skill.output(tempN);
            for (int j = 1; j < 6; j++) {
                Algorithm temp = tempN.getAlg(j);
                if (temp != null) {
                    return new AlgorithmV2(j,temp);
                }
            }
        }
        return null;
    }
    public int getSize(){return skills.size();}
}

class AlgorithmV2{
    private int priority = 0;
    private Algorithm alg = null;

    public AlgorithmV2(int priority, Algorithm alg) {
        this.priority = priority;
        this.alg = alg;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    public Algorithm getAlg() {
        return alg;
    }

    public void setAlg(Algorithm alg) {
        this.alg = alg;
    }
}
 

fukurou

the supreme coder
ADMIN
Java:
public class AXSkillBundle {
    private final ArrayList<DiSkillV2> skills = new ArrayList<DiSkillV2>();
    private final Neuron tempN = new Neuron();
    private Kokoro kokoro = new Kokoro(new AbsDictionaryDB());

    public void setKokoro(Kokoro kokoro) {
        this.kokoro = kokoro;
        for (DiSkillV2 skill : skills) {
            skill.setKokoro(this.kokoro);
        }
    }

    public AXSkillBundle(DiSkillV2...skillsParams) {
        for (DiSkillV2 skill : skillsParams)
        {
            skill.setKokoro(this.kokoro);
            skills.add(skill);
        }
    }
    public AXSkillBundle addSkill(DiSkillV2 skill){
        // builder pattern
        skill.setKokoro(this.kokoro);
        skills.add(skill);
        return this;
    }
    public AlgorithmV2 dispenseAlgorithm(String ear, String skin, String eye){
        for (DiSkillV2 skill : skills) {
            skill.input(ear, skin, eye);
            skill.output(tempN);
            for (int j = 1; j < 6; j++) {
                Algorithm temp = tempN.getAlg(j);
                if (temp != null) {
                    return new AlgorithmV2(j,temp);
                }
            }
        }
        return null;
    }
    public int getSize(){return skills.size();}
}

class AlgorithmV2{
    private int priority = 0;
    private Algorithm alg = null;

    public AlgorithmV2(int priority, Algorithm alg) {
        this.priority = priority;
        this.alg = alg;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    public Algorithm getAlg() {
        return alg;
    }

    public void setAlg(Algorithm alg) {
        this.alg = alg;
    }
}
 

owly

闇の伝説
Staff member
戦闘 コーダー
we need to update the skillhub and the skill branch with the new findings!
 

owly

闇の伝説
Staff member
戦闘 コーダー
wake the fuck up samurai, we got a puzzle to solve
 

fukurou

the supreme coder
ADMIN
Java:
public class SkillHubAlgDispenser {
//     super class to output an algorithm out of a selection of skills
//      engage the hub with dispenseAlg and return the value to outAlg attribute
//      of the containing skill (which houses the skill hub)
//      this module enables using a selection of 1 skill for triggers instead of having the triggers engage on multible skill
//       the methode is ideal for learnability and behavioral modifications
//       use a learnability auxiliary module as a condition to run an active skill shuffle or change methode
//       (rndAlg , cycleAlg)
//       moods can be used for specific cases to change behavior of the AGI, for example low energy state
//       for that use (moodAlg)
    private final ArrayList<DiSkillV2> skills = new ArrayList<DiSkillV2>();
    private int activeSkill = 0;
    private final Neuron tempN = new Neuron();;
    private final Random rand = new Random();
    private Kokoro kokoro = new Kokoro(new AbsDictionaryDB());
    public SkillHubAlgDispenser(DiSkillV2...skillsParams) {
        for (DiSkillV2 skill : skillsParams)
        {
            skill.setKokoro(this.kokoro);
            skills.add(skill);
        }
    }
    public void setKokoro(Kokoro kokoro) {
        this.kokoro = kokoro;
        for (DiSkillV2 skill : skills) {
            skill.setKokoro(this.kokoro);
        }
    }
    public SkillHubAlgDispenser addSkill(DiSkillV2 skill){
        // builder pattern
        skill.setKokoro(this.kokoro);
        skills.add(skill);
        return this;
    }
    public AlgorithmV2 dispenseAlgorithm(String ear, String skin, String eye){
        // return value to outAlg param of (external) summoner DiskillV2
        skills.get(activeSkill).input(ear,skin,eye);
        skills.get(activeSkill).output(tempN);
        for (int i = 1; i < 6; i++) {
            Algorithm temp = tempN.getAlg(i);
            if (temp != null){
                return new AlgorithmV2(i,temp);
            }
        }
        return null;
    }
    public void randomizeActiveSkill(){
        activeSkill = rand.nextInt(skills.size());
    }
    public void setActiveSkillWithMood(int mood){
        // mood integer represents active skill
        // different mood = different behavior
        if ((mood>-1) && mood < (skills.size())){
            activeSkill = mood;
        }
    }
    public void cycleActiveSkill(){
        // changes active skill
        // I recommend this method be triggered with a Learnability or SpiderSense object
        activeSkill++;
        if (activeSkill == skills.size()){
            activeSkill = 0;
        }
    }
    public int getSize(){return skills.size();}
}
 

fukurou

the supreme coder
ADMIN
Java:
public class SkillBranch extends DiSkillV2 {
    // unique skill used to bind similar skills
    /*
    * contains collection of skills
    * mutates active skill if detects conjuration
    * mutates active skill if algorithm results in
    * negative feedback
    * positive feedback negates active skill mutation
    * */
    private Hashtable<String,Integer> skillRef = new Hashtable<>();
    private SkillHubAlgDispenser skillHub = new SkillHubAlgDispenser();
    private AXLearnability ml;

    public SkillBranch(int tolerance) {
        ml = new AXLearnability(tolerance);
    }

    @Override
    public void input(String ear, String skin, String eye) {
        // conjuration alg morph
        if (skillRef.contains(ear)){
            skillHub.setActiveSkillWithMood(skillRef.get(ear));
            setSimpleAlg("hmm");
        }
        // machine learning alg morph
        if (ml.mutateAlg(ear)){
            skillHub.cycleActiveSkill();
            setSimpleAlg("hmm");
        }
        // alg engage
        AlgorithmV2 a1 = skillHub.dispenseAlgorithm(ear,skin,eye);
        if(a1 == null){return;}
        this.outAlg = a1.getAlg();
        this.outpAlgPriority = a1.getPriority();
        ml.pendAlg();
    }
    public void addSkill(DiSkillV2 skill){
        skillHub.addSkill(skill);
    }
    public void addReferencedSkill(DiSkillV2 skill, String conjuration){
        // the conjuration string will engage it's respective skill
        skillHub.addSkill(skill);
        skillRef.put(conjuration, skillHub.getSize());
    }
    // learnability params
    public void addDefcon(String defcon){ml.defcons.add(defcon);}
    public void addGoal(String goal){ml.defcons.add(goal);}
    // while alg is pending, cause alg mutation ignoring learnability tolerance:
    public void addDefconLV5(String defcon5){ml.defcons.add(defcon5);}
    @Override
    public void setKokoro(Kokoro kokoro) {
        super.setKokoro(kokoro);
        skillHub.setKokoro(kokoro);
    }
}
 

fukurou

the supreme coder
ADMIN
Python:
class AlgorithmV2:
    def __init__(self, priority, alg):
        self.priority = priority
        self.alg = alg

    def get_priority(self):
        return self.priority

    def set_priority(self, priority):
        self.priority = priority

    def get_alg(self):
        return self.alg

    def set_alg(self, alg):
        self.alg = alg
 

fukurou

the supreme coder
ADMIN
Python:
class AXSkillBundle:
    def __init__(self, *skills_params: DiSkillV2):
        self.skills: list[DiSkillV2] = []
        self.tempN: Neuron = Neuron()
        self.kokoro: Kokoro = Kokoro(AbsDictionaryDB())

        for skill in skills_params:
            skill.setKokoro(self.kokoro)
            self.skills.append(skill)

    def set_kokoro(self, kokoro):
        self.kokoro = kokoro
        for skill in self.skills:
            skill.setKokoro(self.kokoro)

    def add_skill(self, skill) -> AXSkillBundle:
        # Builder pattern
        skill.setKokoro(self.kokoro)
        self.skills.append(skill)
        return self

    def dispense_algorithm(self, ear, skin, eye):
        for skill in self.skills:
            skill.input(ear, skin, eye)
            skill.output(self.tempN)
            for j in range(1, 6):
                temp = self.tempN.getAlg(j)
                if temp:
                    return AlgorithmV2(j, temp)

        return None

    def get_size(self):
        return len(self.skills)
 
Last edited:

fukurou

the supreme coder
ADMIN
Python:
class DiSkillBundle(DiSkillV2):
    def __init__(self):
        super().__init__()
        self.axSkillBundle: AXSkillBundle = AXSkillBundle()

    def input(self, ear, skin, eye):
        a1 = self.axSkillBundle.dispense_algorithm(ear, skin, eye)
        if a1 is None:
            return
        self._outAlg = a1.get_alg()
        self._outpAlgPriority = a1.get_priority()

    def set_kokoro(self, kokoro):
        super().setKokoro(kokoro)
        self.axSkillBundle.set_kokoro(kokoro)

    def add_skill(self, skill):
        self.axSkillBundle.add_skill(skill)
 

fukurou

the supreme coder
ADMIN
Python:
    bundle_skill:DiSkillBundle = DiSkillBundle()
    bundle_skill.add_skill(DiHelloWorld())
    bundle_skill.add_skill(DiTime())
    # app.brain.logicChobit.addSkill(DiTime())
    # app.brain.logicChobit.addSkill(DiHelloWorld())
    app.brain.logicChobit.addSkill(bundle_skill)

the bundle skill works
 

fukurou

the supreme coder
ADMIN
Python:
class SkillHubAlgDispenser:
    # super class to output an algorithm out of a selection of skills
    """
      engage the hub with dispenseAlg and return the value to outAlg attribute
      of the containing skill (which houses the skill hub)
      this module enables using a selection of 1 skill for triggers instead of having the triggers engage on multible skill
       the methode is ideal for learnability and behavioral modifications
       use a learnability auxiliary module as a condition to run an active skill shuffle or change methode
       (rndAlg , cycleAlg)
       moods can be used for specific cases to change behavior of the AGI, for example low energy state
       for that use (moodAlg)"""

    def __init__(self, *skillsParams: DiSkillV2):
        super().__init__()
        self._skills: list[DiSkillV2] = []
        self._activeSkill: int = 0
        self._tempN: Neuron = Neuron()
        self._kokoro = Kokoro(AbsDictionaryDB())
        for i in range(0, len(skillsParams)):
            skillsParams[i].setKokoro(self._kokoro)
            self._skills.append(skillsParams[i])

    def set_kokoro(self, kokoro):
        self._kokoro = kokoro
        for skill in self._skills:
            skill.setKokoro(self._kokoro)

    def addSkill(self, skill: DiSkillV2) -> SkillHubAlgDispenser:
        # builder pattern
        skill.setKokoro(self._kokoro)
        self._skills.append(skill)
        return self

    def dispenseAlgorithm(self, ear: str, skin: str, eye: str):
        # returns Algorithm? (or None)
        # return value to outAlg param of (external) summoner DiskillV2
        self._skills[self._activeSkill].input(ear, skin, eye)
        self._skills[self._activeSkill].output(self._tempN)
        for i in range(1, 6):
            temp: Algorithm = self._tempN.getAlg(i)
            if temp:
                return AlgorithmV2(i, temp)
        return None

    def randomizeActiveSkill(self):
        self._activeSkill = random.randint(0, len(self._skills) - 1)

    def setActiveSkillWithMood(self, mood: int):
        # mood integer represents active skill
        # different mood = different behavior
        if -1 < mood < len(self._skills) - 1:
            self._activeSkill = mood

    def cycleActiveSkill(self):
        # changes active skill
        # I recommend this method be triggered with a Learnability or SpiderSense object
        self._activeSkill += 1
        if self._activeSkill == len(self._skills):
            self._activeSkill = 0

    def getSize(self) -> int:
        return len(self._skills)
 
Last edited:

fukurou

the supreme coder
ADMIN
Python:
class SkillBranch(DiSkillV2):
    # unique skill used to bind similar skills
    """
    * contains collection of skills
    * mutates active skill if detects conjuration
    * mutates active skill if algorithm results in
    * negative feedback
    * positive feedback negates active skill mutation
    * """

    def __init__(self, tolerance):
        super().__init__()
        self._skillRef: dict[str, int] = {}
        self._skillHub: SkillHubAlgDispenser = SkillHubAlgDispenser()
        self._ml: AXLearnability = AXLearnability(tolerance)
        self._kokoro: Kokoro = Kokoro(AbsDictionaryDB())

    def set_kokoro(self, kokoro):
        super().setKokoro(kokoro)
        self._skillHub.set_kokoro(kokoro)

    def input(self, ear, skin, eye):
        # Conjuration alg morph
        if ear in self._skillRef:
            self._skillHub.setActiveSkillWithMood(self._skillRef[ear])
            self.setSimpleAlg("hmm")

        # Machine learning alg morph
        if self._ml.mutateAlg(ear):
            self._skillHub.cycleActiveSkill()
            self.setSimpleAlg("hmm")

        # Alg engage
        a1 = self._skillHub.dispenseAlgorithm(ear, skin, eye)
        if a1:
            self._outAlg = a1.get_alg()
            self._outpAlgPriority = a1.get_priority()
        self._ml.pendAlg()

    def addSkill(self, skill):
        self._skillHub.addSkill(skill)

    def addReferencedSkill(self, skill, conjuration):
        # the conjuration string will engage it's respective skill
        self._skillHub.addSkill(skill)
        self._skillRef[conjuration] = self._skillHub.getSize()

    # learnability params
    def addDefcon(self, defcon):
        self._ml.defcons.insert(defcon)

    def addGoal(self, goal):
        self._ml.defcons.insert(goal)

    # while alg is pending, cause alg mutation ignoring learnability tolerance:
    def addDefconLV5(self, defcon5):
        self._ml.defcons.insert(defcon5)
 

fukurou

the supreme coder
ADMIN
Python:
class SkillBranch(DiSkillV2):
    # unique skill used to bind similar skills
    """
    * contains collection of skills
    * mutates active skill if detects conjuration
    * mutates active skill if algorithm results in
    * negative feedback
    * positive feedback negates active skill mutation
    * """

    def __init__(self, tolerance):
        super().__init__()
        self._skillRef: dict[str, int] = {}
        self._skillHub: SkillHubAlgDispenser = SkillHubAlgDispenser()
        self._ml: AXLearnability = AXLearnability(tolerance)
        self._kokoro: Kokoro = Kokoro(AbsDictionaryDB())

    def set_kokoro(self, kokoro):
        super().setKokoro(kokoro)
        self._skillHub.set_kokoro(kokoro)

    def input(self, ear, skin, eye):
        # conjuration alg morph
        if ear in self._skillRef:
            self._skillHub.setActiveSkillWithMood(self._skillRef[ear])
            self.setSimpleAlg("hmm")
        # machine learning alg morph
        if self._ml.mutateAlg(ear):
            self._skillHub.cycleActiveSkill()
            self.setSimpleAlg("hmm")
        # alg engage
        a1: AlgorithmV2 = self._skillHub.dispenseAlgorithm(ear, skin, eye)
        if a1:
            self.setOutalg(a1.get_alg())
            self.setOutAlgPriority(a1.get_priority())
            self._ml.pendAlg()

    def addSkill(self, skill):
        self._skillHub.addSkill(skill)

    def addReferencedSkill(self, skill, conjuration):
        # the conjuration string will engage it's respective skill
        self._skillHub.addSkill(skill)
        self._skillRef[conjuration] = self._skillHub.getSize()

    # learnability params
    def addDefcon(self, defcon):
        self._ml.defcons.insert(defcon)

    def addGoal(self, goal):
        self._ml.defcons.insert(goal)

    # while alg is pending, cause alg mutation ignoring learnability tolerance:
    def addDefconLV5(self, defcon5):
        self._ml.defcons.insert(defcon5)
 
Top