algebra.portSearchChain
This function gives the exact chain of the search: the share of each count of connects to one destination, over `rounds` rounds. Each round closes its connections with a reset, and the next round starts where the last connect of the round before put the start. The first round starts at each even offset with the same chance.
CLI- Package
- @procedures/algebra · README
- Path
["algebra","portSearchChain"]- CLI
mark algebra portSearchChain --size <number>- As data
{"$proc":["algebra","portSearchChain"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/algebra/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["algebra","portSearchChain"], { size: 1 });
console.log(JSON.stringify(result));From the command line
$ mark algebra portSearchChain --size <number>
As data, in a program
{ "$proc": ["algebra", "portSearchChain"], "input": { "size": 1 } }Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
size | number | yes | ||
rounds | number | no |
Output
The schema does not list fields (any[][]).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"size": {
"type": "number"
},
"rounds": {
"type": "number"
}
},
"required": [
"size"
],
"additionalProperties": false
},
"output": {
"type": "array",
"items": {
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2,
"maxItems": 2
},
"x-procedures-codec": "map"
}
}