About

tree river fish is a human-centered intelligence written in Swift. It has source code. It has a web site. And it has this document to explain it

tree river fish can synchronize resources, group personalities, and create a theater of mind

You can learn more about tree river fish from exploring the classes it defines

trfSync

trfSync provides a way to synchronize tasks based on their exclusive use of shared resources and their expected duration

You put trfTask instances into an instance of trfSync, then call trfSync.synchronize()

What you get back is an array of batches of tasks. Each batch can be executed in order, independently of the other batches

let sync = trfSync()
let taskCount = 64
for _ in 0..<taskCount {
    var resources = [Bool]()
    let resourceCount = 64
    for i in 0..<resourceCount {
        resources[i] = Bool.random()
    }
    let taskID = Int.random(in: 0..<1000000)
    var duration = Double.random(in: 0.0..<1.0)
    var task = trfTask(id: taskID,
                       resourceMap: resources,
                       expectedDuration: duration)
    sync.addTask(task: task)
}
var batches = sync.synchronize()

Now, batches is an Set of Arrays of Int task ids that you can use to execute your tasks

for batch in batches {
    for task in batch {
        print("\\(task.id)")
    }
    print("")
}

Don’t sort. Pick a task at random and grab all its subordinate tasks? (Or: do both)

trfBit >> enum

trfTask.taskID passed in from outside

Return an array of array of taskID ??

synchronizes 32-bit resource templates, stacking them in a way that as many multiple things happen at the same time as possible. Usable for synchronizing a process table. ((Creates the smallest possible number of piles each one of which is done in order??))..example of aircraft or road transportation scheduling of some sort

Its resources need to specify exclusive or shared or no use of a resource needed in a resource map? Tasks take a time parameter which is given any unit as long as they’re all the same optional expected duration

trfSync::synchronize()

trfBatch::addTask() ::order() ::stacks[]

trfRandomStats