Divooka Reference

Orders and Matchings

4 nodes

On this page 4

Maximum Matching

Function

As many pairs as can be made between a left set and a right set, each pair along an allowed edge and nothing used twice: workers to jobs, players to seats. The nth edge joins left[n] to right[n].

Signature
MaximumMatching -> (Pairs: Integer, partners: Integer Array)
    leftCount: Integer
    rightCount: Integer
    edgeLefts: Integer Array
    edgeRights: Integer Array
int MaximumMatching(
    int leftCount,
    int rightCount,
    int[] edgeLefts,
    int[] edgeRights,
    out int[] partners)

Parameters

nametypedefaultdescription
leftCountInteger—How many on the left, numbered from 0.
rightCountInteger—How many on the right, numbered from 0.
edgeLeftsInteger Array—Each allowed edge's left end.
edgeRightsInteger Array—Each allowed edge's right end.

Returns

PairsInteger
partnersInteger Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Orders and Matchings
Package
Crime Engine

Random Permutation

Function

The numbers 0 to count - 1 in a random order.

Signature
Permutation(count: Integer, seed: Integer) -> Integer Array
int[] Permutation(int count, int seed = 1)

Parameters

nametypedefaultdescription
countInteger—How many.
seedInteger1The same seed gives the same order.

Returns

OrderInteger Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Orders and Matchings
Package
Crime Engine

Random Sample

Function

Some of the numbers 0 to from - 1, none twice, in a random order.

Signature
Sample -> Integer Array
    count: Integer
    from: Integer
    seed: Integer
int[] Sample(int count, int from, int seed = 1)

Parameters

nametypedefaultdescription
countInteger—How many to take.
fromInteger—How many there are to take from.
seedInteger1The same seed gives the same sample.

Returns

SampleInteger Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Orders and Matchings
Package
Crime Engine

Shuffle Numbers

Function

The numbers in a random order.

Signature
Shuffle(values: Integer Array, seed: Integer) -> Integer Array
int[] Shuffle(int[] values, int seed = 1)

Parameters

nametypedefaultdescription
valuesInteger Array—The numbers.
seedInteger1The same seed gives the same order.

Returns

ShuffledInteger Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Orders and Matchings
Package
Crime Engine