Giter VIP home page Giter VIP logo

laserfocuskit-swift's Introduction

Laser Focus Header

LaserFocusKit-Swift

Utility library for calculations when applying the Laser Focus priority strategy.

Usage

VECTOR

This library calculates the overall priority for a given graph of categorized actionable items, such as features or tasks. It supports any number of actionable item levels, e.g. you can provide an entire range of levels like "Epic", "Story", "Feature", "Task", "Sub-Task", "Step" as input. The main method takes just the top level ("Epic" in this case) and walks through the other children levels automatically.

For example, imagine you have the features "A", "B", and "C". Some of them have 3 tasks "1", "2", and "3". And some of the tasks have subtasks, "x", "y", and "z". So the input is this top level array with its children:

let inputs: [ActionableInput] = [
  .init(name: "A", localCategory: .vital, children: [
    .init(name: "A1", localCategory: .vital, children: [
      .init(name: "A1x", localCategory: .vital),
      .init(name: "A1y", localCategory: .essential),
      .init(name: "A1z", localCategory: .completing)]
    ),
    .init(name: "A2", localCategory: .essential),
    .init(name: "A3", localCategory: .completing, children: [
      .init(name: "A3x", localCategory: .vital),
      .init(name: "A3y", localCategory: .essential),
      .init(name: "A3z", localCategory: .completing)]
    )]
  ),
  .init(name: "B", localCategory: .optional, children: [
    .init(name: "B1", localCategory: .vital),
    .init(name: "B2", localCategory: .essential, children: [
      .init(name: "B2x", localCategory: .vital),
      .init(name: "B2y", localCategory: .retracting),
      .init(name: "B2z", localCategory: .completing)]
    )]
  ),
  .init(name: "C", localCategory: .completing)
]

What we want to know in the Laser Focus strategy, is the global category for each "leaf" element in the graph, or the elements without children, the "atomic" elements, so to say. These elements are not further split(table) and can directly be worked on. Just calling the LaserFocus.prioritizedAtoms(inputs:) gives us exactly these elements:

let outputs: [ActionableOutput] = LaserFocus.prioritizedAtoms(inputs: inputs)

Each element in ActionableOutput has a globalCategory which includes the overall category of the atomic actionable, which serves as the primary prioritization point. Additionally, each ActionableOutput also has an averageCategoryRawValue numeric property which can be used to prioritize tasks with the same globalCategory for improved precision.

The simplest way to get the list of tasks in the correct priority order is to just call sorted() on the outputs as ActionableOutput is Comparable:

let sortedOutputs: [ActionableOutput] = outputs.sorted()

print(sortedOutputs.map(\.name)) // => ["A1x", "A1y", "A2", "A1z", "A3x", "A3y", "A3z", "C", "B2x", "B1", "B2z", "B2y"]

Note that both the input ActionableInput and output type ActionableOutput are Codable and can therefore be easily read from & written to JSON.

laserfocuskit-swift's People

Contributors

jeehut avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.