Skip to content

SkillBranch

Moti Barski edited this page Apr 10, 2025 · 1 revision

LivinGrimoire SkillBranch

The SkillBranch is a unique skill LivinGrimoire (software design pattern) skill, designed to manage multiple skills while ensuring only one remains active at any given time. The active skill is determined through a sophisticated learnability algorithm, which takes into account factors such as tolerance (int), negative input (defcon), and positive input. Additionally, the active skill can be manually set via specific commands.

Key Benefits

  1. Auto Learnability: The SkillBranch learns to optimize which skill will be active based on usage patterns.
  2. Unified Triggers: A single set of triggers can be used for a collection of skills, engaging only the currently active skill.
  3. Skill Categorization: Skills can be bundled into categories for more efficient management.

Example Usage

t: SkillBranch = SkillBranch(3)  # Tolerance for defcon before active skill change
t.addDefcon("lame")
t.addGoal("thanks")
t.addSkill(DiSmoothie0())
t.addSkill(DiSmoothie1())
app.chobit.addSkill(t)

SkillBranch Class Overview

The SkillBranch class comprises methods and attributes crucial to its functionality. Below are the method signatures and their descriptions:

class SkillBranch(Skill):
    """
    * Manages a collection of skills
    * Automatically adjusts the active skill based on input and learnability algorithms
    * Responds to both positive and negative feedback
    """
    
    def __init__(self, tolerance: int):
        """
        Initialize SkillBranch with the specified tolerance for defcon.
        """
        pass

    def input(self, ear: str, skin: str, eye: str):
        """
        automatically set to the active Skill's input method.
        """
        pass

    def addSkill(self, skill: Skill):
        """
        Add a new skill to the SkillBranch.
        """
        pass

    def addReferencedSkill(self, skill: Skill, conjuration: str):
        """
        Add a skill and associate it with a conjuration string for engagement.
        """
        pass

    def addDefcon(self, defcon: str):
        """
        Add a defcon (negative input) for the learnability algorithm.
        """
        pass

    def addGoal(self, goal: str):
        """
        Add a goal (positive input) for the learnability algorithm.
        """
        pass

    def addDefconLV5(self, defcon5: str):
        """
        Add a level 5 defcon to trigger an immediate skill change, bypassing tolerance.
        """
        pass

    def skillNotes(self, param: str) -> str:
        """
        returns active Skill's skillNotes
        """
        pass

Conclusion

The SkillBranch skill within the LivinGrimoire system offers a powerful way to manage and optimize the use of multiple skills. By leveraging advanced learnability algorithms and unified triggers, it ensures efficient and effective skill management.


LivinGrimoire SkillBranch1Liner

The SkillBranch1Liner is a subclass of the SkillBranch that offers the same functionality but allows the creation of a SkillBranch with a single line of code. This streamlined approach can make the code more concise and easier to read.

Key Benefits

  1. Concise Initialization: Create a SkillBranch with goals, defcons, and skills in a single line.
  2. Same Powerful Features: Inherits all the features and learnability algorithms of SkillBranch.
  3. Readability: Simplifies code and enhances readability for quick setups.

Example Usage

app.chobit.addSkill(SkillBranch1Liner("thanks", "lame", 3, DiSmoothie0(), DiSmoothie1()))

SkillBranch1Liner Class Overview

The SkillBranch1Liner class inherits from SkillBranch and provides a constructor for concise initialization:

class SkillBranch1Liner(SkillBranch):
    """
    * Inherits all features of SkillBranch
    * Provides a one-liner constructor for initialization
    """
    
    def __init__(self, goal: str, defcon: str, tolerance: int, *skills: Skill):
        """
        Initialize SkillBranch1Liner with goal, defcon, tolerance, and skills in a single line.
        """
        super().__init__(tolerance)
        self.addGoal(goal)
        self.addDefcon(defcon)
        for skill in skills {
            self.addSkill(skill)
        }
    }

Conclusion

The SkillBranch1Liner offers a streamlined and concise way to create and manage skills within the LivinGrimoire system. It retains all the advanced learnability algorithms and unified triggers of the SkillBranch, making it an efficient and effective tool for skill management.


Clone this wiki locally