@mark1russell7/layout-contract 0.2.8 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/build/index.d.ts +269 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +866 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/corpus.ts +197 -0
- package/src/index.ts +2 -0
- package/src/strategy-space.ts +854 -0
package/README.md
CHANGED
|
@@ -20,6 +20,10 @@ The package has no runtime dependencies.
|
|
|
20
20
|
| The promotion guards | `outputGroups`, `OutputGroup`, `exercised`, `ExerciseEvidence` |
|
|
21
21
|
| The portfolio | `portfolio`, `Portfolio`, `PortfolioKey`, `PortfolioLevel`, `PortfolioOptions`, `PortfolioPick`, `PortfolioTrace`, `Member`, `MemberTrace`, `MemberStatus`, `pickMoves` |
|
|
22
22
|
| The pick rule | `selectBest`, `SelectCandidate`, `SelectLevel`, `Selection`, `PickSpec` |
|
|
23
|
+
| The corpus checks | `ClaimBreak`, `checkDeclared`, `declaredCounts`, `declaredClaimOf`, `DeclaredClaim`, `Declares`, `corpusHashOf`, `CorpusEntry` |
|
|
24
|
+
| The split files | `checkSplit`, `splitFolds`, `leaveOneSeedOut`, `splitFileName`, `SPLIT_SCHEMA`, `CorpusSplit`, `SplitFold`, `SplitCorpus` |
|
|
25
|
+
| The strategy space | `StrategySpace`, `SpaceStage`, `StageOption`, `SpaceParam`, `ParamWhen`, `MemberRule`, `SpaceConstraint`, `OptionRef`, `StrategyConfig`, `StageChoice`, `ParamKind`, `ParamValue`, `STRATEGY_SPACE_SCHEMA` |
|
|
26
|
+
| The space functions | `checkSpace`, `checkConfig`, `canonicalConfig`, `configId`, `spaceSize`, `paramLevels`, `enumerateSpace`, `productSpace`, `joinConfigs`, `splitConfig`, `SpaceSize`, `SpaceSizeOptions`, `EnumerateOptions`, `GridOptions`, `SampleOptions` |
|
|
23
27
|
| The turn | `turnBox`, `turnPort`, `turnMargin`, `turnRegion`, `turnSide`, `turnPoint` |
|
|
24
28
|
| The tolerances | `EPS`, `RECORD_EPS`, `RECORD_SCALE`, `Tolerance`, `DEFAULT_TOLERANCE` |
|
|
25
29
|
| The hard rules | `countOverlaps`, `countObstacleHits`, `regionHitsRect`, `rectInRegion`, `countOutside`, `ContainerTest`, `countPortsOffBorder`, `packHard`, `PackHard`, `placedRect`, `checkInput` |
|
|
@@ -34,6 +38,7 @@ The package has no runtime dependencies.
|
|
|
34
38
|
- **The container rule.** `in-container` counts each box that goes out of the container made smaller by `inset`. The box counts with its margin. By default, a shaped container counts as its bounding box.
|
|
35
39
|
- **The exact container.** Give `{ exactContainer: true }` to `packHard` or `countOutside`. Then a box of a shaped container with the size `fixed` must stay inside the shape. A cut corner, a notch and a hole count. A container with a free side keeps the bounding test. The default changes to the exact test at the next breaking version.
|
|
36
40
|
- **The output hash.** `outputHash` gives the first 16 hex characters of the SHA-256 of the canonical JSON of an output. Each number goes to the grid of `RECORD_EPS` first.
|
|
41
|
+
- **The corpus checks.** `checkDeclared` and `checkSplit` give a list of `ClaimBreak`. An empty list tells that each claim is true. `corpusHashOf` gives the corpus hash of `packing`.
|
|
37
42
|
- **The tolerances.** `EPS` (`1e-6`) is for the float compares in an engine. `RECORD_EPS` (`1e-3`) is for the compares on a written file. A record writes the tolerance of each hard rule in its field `tolerance`. The defaults are `overlap` `0.001` and `through` `0.5`.
|
|
38
43
|
|
|
39
44
|
## An example
|
|
@@ -53,4 +58,4 @@ const placed = applyPack(input, output);
|
|
|
53
58
|
const hard = packHard(input, output);
|
|
54
59
|
```
|
|
55
60
|
|
|
56
|
-
The formats are in `docs/FORMAT.md` of `packing` and `docs/LAYOUT-RECORDS.md` of `highways`. The joint measures are in `docs/JOINT-MEASURES.md` of this repository, and the joint corpus is in `docs/JOINT-CORPUS.md`. The promotion guards are in `docs/PROMOTION.md`. The portfolio and its pick rule are in `docs/PORTFOLIO.md`.
|
|
61
|
+
The formats are in `docs/FORMAT.md` of `packing` and `docs/LAYOUT-RECORDS.md` of `highways`. The joint measures are in `docs/JOINT-MEASURES.md` of this repository, and the joint corpus is in `docs/JOINT-CORPUS.md`. The promotion guards are in `docs/PROMOTION.md`. The portfolio and its pick rule are in `docs/PORTFOLIO.md`. The corpus checks and the split files are in `docs/CORPUS-CHECKS.md`. The strategy space is in [`docs/STRATEGY-SPACE.md`](https://github.com/mark1russell7/layout-contract/blob/main/docs/STRATEGY-SPACE.md).
|
package/build/index.d.ts
CHANGED
|
@@ -697,4 +697,273 @@ export declare function pickMoves(trace: Pick<PortfolioTrace, "picked">): {
|
|
|
697
697
|
* It also throws a `RangeError` for an empty list of members, or for two members with the same id.
|
|
698
698
|
*/
|
|
699
699
|
export declare function portfolio<I, O>(id: string, members: readonly Member<I, O>[] | ((input: I) => readonly Member<I, O>[]), key: PortfolioKey<I, O>, options?: PortfolioOptions): Portfolio<I, O>;
|
|
700
|
+
/** One broken claim of a corpus, with the ids of the inputs that break it. */
|
|
701
|
+
export interface ClaimBreak {
|
|
702
|
+
/** The name of the claim, for example `declared`, `split` or `index`. */
|
|
703
|
+
readonly claim: string;
|
|
704
|
+
/** The text of the break. */
|
|
705
|
+
readonly detail: string;
|
|
706
|
+
/** The ids of the inputs that break the claim. The list is empty when the break has no input. */
|
|
707
|
+
readonly inputs: readonly string[];
|
|
708
|
+
}
|
|
709
|
+
/** The claim `claims.declared` of a manifest: the count of the inputs for each declared property. */
|
|
710
|
+
export interface DeclaredClaim {
|
|
711
|
+
/** A property with fewer inputs than this count is thin. */
|
|
712
|
+
readonly minCount: number;
|
|
713
|
+
/** The ids of the properties with a count below `minCount`. */
|
|
714
|
+
readonly thin: readonly string[];
|
|
715
|
+
/** The count of the inputs for each property id. */
|
|
716
|
+
readonly counts: Readonly<Record<string, number>>;
|
|
717
|
+
}
|
|
718
|
+
/** The hook that gives the ids of the properties that one input declares. */
|
|
719
|
+
export type Declares<I> = (input: I) => readonly string[];
|
|
720
|
+
/**
|
|
721
|
+
* This function gives the count of the inputs for each property id. Each id of `ids` has a count, also when the count is 0.
|
|
722
|
+
* An id from `declares` that is not in `ids` comes after the ids of `ids`, in the order of the first input that declares it.
|
|
723
|
+
*/
|
|
724
|
+
export declare function declaredCounts<I>(inputs: Iterable<I>, declares: Declares<I>, ids?: readonly string[]): Record<string, number>;
|
|
725
|
+
/**
|
|
726
|
+
* This function reads the field `claims.declared` of a manifest. A manifest without it gives `undefined`.
|
|
727
|
+
* It throws an `Error` for a claim without a whole `minCount`, a list `thin` of ids and a whole count for each id.
|
|
728
|
+
*/
|
|
729
|
+
export declare function declaredClaimOf(manifest: object): DeclaredClaim | undefined;
|
|
730
|
+
/**
|
|
731
|
+
* This function checks the claim `claims.declared` against the inputs. It gives one break `declared` for each problem. An empty list tells that the claim is true.
|
|
732
|
+
*
|
|
733
|
+
* - `ids` are the property ids. The default is the ids of `claim.counts`.
|
|
734
|
+
* - Each id of `ids` has a count in `claim.counts`, and `claim.counts` has no other id. Each count is the count of the inputs.
|
|
735
|
+
* - An id with a count below `minCount` is in `thin`. Each id of `thin` is an id of `ids`.
|
|
736
|
+
* - Each id that `declares` gives is an id of `ids`.
|
|
737
|
+
*/
|
|
738
|
+
export declare function checkDeclared<I>(inputs: Iterable<I>, declares: Declares<I>, claim: DeclaredClaim, ids?: readonly string[]): ClaimBreak[];
|
|
739
|
+
/** The id and the hash of one input of a corpus. */
|
|
740
|
+
export interface CorpusEntry {
|
|
741
|
+
readonly id: string;
|
|
742
|
+
readonly hash: string;
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* This function gives the hash of a corpus: the first 16 hex characters of a SHA-256. The text of the SHA-256 is `canonicalJson`
|
|
746
|
+
* of the corpus id and the `[id, hash]` of each input, in the order of the manifest. A change of one input changes the hash.
|
|
747
|
+
*/
|
|
748
|
+
export declare function corpusHashOf(corpus: string, inputs: readonly CorpusEntry[]): string;
|
|
749
|
+
/** The schema of a split file. */
|
|
750
|
+
export declare const SPLIT_SCHEMA = "corpus-split/1";
|
|
751
|
+
/** One fold of a split: the seeds that fit a selector and the seeds that score it. */
|
|
752
|
+
export interface SplitFold {
|
|
753
|
+
readonly train: readonly number[];
|
|
754
|
+
readonly heldOut: readonly number[];
|
|
755
|
+
}
|
|
756
|
+
/** A split file `corpus-split/1`. Its name is `<corpus id>.<corpus hash>.json`. It is beside the corpus, so the corpus does not change. */
|
|
757
|
+
export interface CorpusSplit {
|
|
758
|
+
readonly schema: typeof SPLIT_SCHEMA;
|
|
759
|
+
readonly corpus: string;
|
|
760
|
+
/** The hash of the corpus: `corpusHashOf` of its manifest. */
|
|
761
|
+
readonly corpusHash: string;
|
|
762
|
+
/** The splits by name. Each split has one fold or more. */
|
|
763
|
+
readonly splits: Readonly<Record<string, {
|
|
764
|
+
readonly folds: readonly SplitFold[];
|
|
765
|
+
}>>;
|
|
766
|
+
}
|
|
767
|
+
/** The fields of a manifest that the split check reads. */
|
|
768
|
+
export interface SplitCorpus {
|
|
769
|
+
readonly corpus: string;
|
|
770
|
+
readonly specs: readonly {
|
|
771
|
+
readonly seeds: readonly number[];
|
|
772
|
+
}[];
|
|
773
|
+
readonly inputs: readonly CorpusEntry[];
|
|
774
|
+
}
|
|
775
|
+
/** This function gives the name of the split file of a corpus. */
|
|
776
|
+
export declare function splitFileName(corpus: string, hash: string): string;
|
|
777
|
+
/**
|
|
778
|
+
* This function checks a split file against a manifest. It gives one break `split` for each problem. An empty list tells that the file is good.
|
|
779
|
+
*
|
|
780
|
+
* - The schema is `corpus-split/1`, the corpus is the id of the manifest and `corpusHash` is `corpusHashOf` of the manifest.
|
|
781
|
+
* - Each split has one fold or more. In each fold, `train` and `heldOut` are lists of seeds, not empty and with no common seed.
|
|
782
|
+
* - Each seed is a seed of a spec of the manifest.
|
|
783
|
+
* - With `name`, the file has the split `name`.
|
|
784
|
+
*/
|
|
785
|
+
export declare function checkSplit(split: unknown, corpus: SplitCorpus, name?: string): ClaimBreak[];
|
|
786
|
+
/**
|
|
787
|
+
* This function gives a copy of the folds of the split `name` of a split file. `where` names the file in the text of an error.
|
|
788
|
+
* It throws an `Error` for each problem of `checkSplit`, and then for an unknown split name.
|
|
789
|
+
*/
|
|
790
|
+
export declare function splitFolds(split: unknown, corpus: SplitCorpus, name: string, where?: string): SplitFold[];
|
|
791
|
+
/** This function gives the folds that hold out one seed each, in the order of the seeds. Each fold trains on the other seeds. */
|
|
792
|
+
export declare function leaveOneSeedOut(seeds: readonly number[]): SplitFold[];
|
|
793
|
+
/** The schema of a strategy space. */
|
|
794
|
+
export declare const STRATEGY_SPACE_SCHEMA = "strategy-space/1";
|
|
795
|
+
/** The kind of a param: a whole number, a real number, one value of a list, or `true` and `false`. */
|
|
796
|
+
export type ParamKind = "int" | "real" | "enum" | "bool";
|
|
797
|
+
/** The value of one param in a config. */
|
|
798
|
+
export type ParamValue = number | string | boolean;
|
|
799
|
+
/** The condition of a conditional param: the param is active only when an earlier param of the same option has one of the values `in`. */
|
|
800
|
+
export interface ParamWhen {
|
|
801
|
+
/** The name of an earlier param of the same option. */
|
|
802
|
+
readonly param: string;
|
|
803
|
+
/** The values of that param that make this param active. */
|
|
804
|
+
readonly in: readonly ParamValue[];
|
|
805
|
+
}
|
|
806
|
+
/** One param of a stage option, with its range. */
|
|
807
|
+
export interface SpaceParam {
|
|
808
|
+
readonly name: string;
|
|
809
|
+
readonly kind: ParamKind;
|
|
810
|
+
/** The smallest value of an `int` or `real` param. */
|
|
811
|
+
readonly min?: number;
|
|
812
|
+
/** The largest value of an `int` or `real` param. */
|
|
813
|
+
readonly max?: number;
|
|
814
|
+
/** The step of the values from `min`. An `int` param has the step 1 by default. */
|
|
815
|
+
readonly step?: number;
|
|
816
|
+
/** The scale of the grid and of the samples. The scale `log` needs a `min` above 0. The default is `linear`. */
|
|
817
|
+
readonly scale?: "linear" | "log";
|
|
818
|
+
/** The values of an `enum` param. */
|
|
819
|
+
readonly values?: readonly (string | number)[];
|
|
820
|
+
/** The value that a config gets when it does not set the param. */
|
|
821
|
+
readonly default: ParamValue;
|
|
822
|
+
/** Without `when`, the param is active each time its option is chosen. */
|
|
823
|
+
readonly when?: ParamWhen;
|
|
824
|
+
}
|
|
825
|
+
/** The rule of the members of a meta option: a count from `min` to `max`. Members with `ordered: false` are sorted by their `configId`. */
|
|
826
|
+
export interface MemberRule {
|
|
827
|
+
readonly min: number;
|
|
828
|
+
readonly max: number;
|
|
829
|
+
readonly ordered: boolean;
|
|
830
|
+
}
|
|
831
|
+
/** One implementation of a stage. An option with `members` is a meta option: it chooses between whole configs, or wraps them. */
|
|
832
|
+
export interface StageOption {
|
|
833
|
+
readonly id: string;
|
|
834
|
+
readonly params: readonly SpaceParam[];
|
|
835
|
+
readonly members?: MemberRule;
|
|
836
|
+
}
|
|
837
|
+
/** One stage of the pipeline of an engine. A config of an `optional` stage can have no option. */
|
|
838
|
+
export interface SpaceStage {
|
|
839
|
+
readonly name: string;
|
|
840
|
+
readonly options: readonly StageOption[];
|
|
841
|
+
readonly optional?: boolean;
|
|
842
|
+
}
|
|
843
|
+
/** A reference to one option of a stage. The option `null` refers to an optional stage that a config does not use. */
|
|
844
|
+
export interface OptionRef {
|
|
845
|
+
readonly stage: string;
|
|
846
|
+
readonly option: string | null;
|
|
847
|
+
}
|
|
848
|
+
/** A rule that keeps out invalid combinations. A config with the option `if` also has the option `then`, or does not have the option `then.not`. */
|
|
849
|
+
export interface SpaceConstraint {
|
|
850
|
+
readonly if: OptionRef;
|
|
851
|
+
readonly then: OptionRef | {
|
|
852
|
+
readonly not: OptionRef;
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
/** The strategy space of an engine: the stages, the constraints and the named configs. `docs/STRATEGY-SPACE.md` tells the rules. */
|
|
856
|
+
export interface StrategySpace {
|
|
857
|
+
readonly schema: typeof STRATEGY_SPACE_SCHEMA;
|
|
858
|
+
/** The name of the space. A config names the space with this value. */
|
|
859
|
+
readonly engine: string;
|
|
860
|
+
/** The version of the space. It is not part of a config or of its id. A record writes it. */
|
|
861
|
+
readonly version: string;
|
|
862
|
+
readonly stages: readonly SpaceStage[];
|
|
863
|
+
readonly constraints?: readonly SpaceConstraint[];
|
|
864
|
+
/** The named strategies of the engine, as points of the space. Old records stay comparable through them. */
|
|
865
|
+
readonly named?: Readonly<Record<string, StrategyConfig>>;
|
|
866
|
+
/** The spaces of a product space, from `productSpace`. A meta option of a part takes members of that part. */
|
|
867
|
+
readonly parts?: readonly StrategySpace[];
|
|
868
|
+
}
|
|
869
|
+
/** The choice of one stage in a config: an option, its params and, for a meta option, its members. */
|
|
870
|
+
export interface StageChoice {
|
|
871
|
+
readonly option: string;
|
|
872
|
+
/** The values of the active params. A param that is not set gets its default. */
|
|
873
|
+
readonly params?: Readonly<Record<string, ParamValue>>;
|
|
874
|
+
/** The members of a meta option: configs of the same space, with no meta option. */
|
|
875
|
+
readonly members?: readonly StrategyConfig[];
|
|
876
|
+
}
|
|
877
|
+
/** One point of a strategy space. The value `null` of a stage tells that the config does not use the optional stage. */
|
|
878
|
+
export interface StrategyConfig {
|
|
879
|
+
/** The `engine` of the space, without its version. */
|
|
880
|
+
readonly space: string;
|
|
881
|
+
readonly stages: Readonly<Record<string, StageChoice | null>>;
|
|
882
|
+
}
|
|
883
|
+
/** The count of the grid points of a space. */
|
|
884
|
+
export interface SpaceSize {
|
|
885
|
+
/** The count of the configs without a meta option. */
|
|
886
|
+
readonly base: bigint;
|
|
887
|
+
/** The count of the configs with a meta option. The value is `null` when the count is more than `maxMeta`. */
|
|
888
|
+
readonly meta: bigint | null;
|
|
889
|
+
}
|
|
890
|
+
/** The options of `spaceSize`. */
|
|
891
|
+
export interface SpaceSizeOptions {
|
|
892
|
+
/** The count of the levels of each numeric param, a whole number of 1 or more. */
|
|
893
|
+
readonly levels: number;
|
|
894
|
+
/** The largest meta count that `spaceSize` gives. The default is `10n ** 18n`. */
|
|
895
|
+
readonly maxMeta?: bigint;
|
|
896
|
+
}
|
|
897
|
+
/** The options of a grid. The grid gives only the configs without a meta option. */
|
|
898
|
+
export interface GridOptions {
|
|
899
|
+
readonly mode: "grid";
|
|
900
|
+
readonly levels: number;
|
|
901
|
+
/** The largest count of configs. A larger grid causes a `RangeError`. The default is 100000. */
|
|
902
|
+
readonly limit?: number;
|
|
903
|
+
}
|
|
904
|
+
/** The options of a sample. */
|
|
905
|
+
export interface SampleOptions {
|
|
906
|
+
readonly mode: "sample";
|
|
907
|
+
/** The count of the configs, a whole number of 0 or more. */
|
|
908
|
+
readonly n: number;
|
|
909
|
+
readonly seed: number;
|
|
910
|
+
/** With `skip` (the default), the sample has no meta option. With `sample`, a meta option draws its members from base samples. */
|
|
911
|
+
readonly meta?: "skip" | "sample";
|
|
912
|
+
/** The largest count of option draws. The default is the larger value of 1000 and `100 * n`. */
|
|
913
|
+
readonly maxTries?: number;
|
|
914
|
+
}
|
|
915
|
+
/** The options of `enumerateSpace`. */
|
|
916
|
+
export type EnumerateOptions = GridOptions | SampleOptions;
|
|
917
|
+
/**
|
|
918
|
+
* This function checks one config of a space. It gives one break for each problem. An empty list tells that the config is good.
|
|
919
|
+
* The `claim` of a break is the kind of the problem, for example `missing`, `unknown`, `inactive`, `param`, `constraint`, `members` or `depth`.
|
|
920
|
+
*/
|
|
921
|
+
export declare function checkConfig(space: StrategySpace, config: StrategyConfig): ClaimBreak[];
|
|
922
|
+
/**
|
|
923
|
+
* This function checks a space. It gives one break for each problem. An empty list tells that the space is good.
|
|
924
|
+
* It finds duplicate names, empty ranges, defaults out of range, enums without values, bad log scales, unknown names and bad named configs.
|
|
925
|
+
* The `inputs` of a break of a named config have the name of the config.
|
|
926
|
+
*/
|
|
927
|
+
export declare function checkSpace(space: StrategySpace): ClaimBreak[];
|
|
928
|
+
/**
|
|
929
|
+
* This function gives the canonical form of a config: each stage of the space, the active params only, the defaults, and stable numbers.
|
|
930
|
+
* An unused optional stage is `null`. The members of an unordered meta option are sorted by their `configId`.
|
|
931
|
+
* It throws an `Error` for a config with a break of `checkConfig`.
|
|
932
|
+
*/
|
|
933
|
+
export declare function canonicalConfig(space: StrategySpace, config: StrategyConfig): StrategyConfig;
|
|
934
|
+
/**
|
|
935
|
+
* This function gives the id of a config: the first 16 hex characters of the SHA-256 of `canonicalJson` of `canonicalConfig`.
|
|
936
|
+
* Two spellings of one config get one id. The version of the space is not part of the id.
|
|
937
|
+
*/
|
|
938
|
+
export declare function configId(space: StrategySpace, config: StrategyConfig): string;
|
|
939
|
+
/**
|
|
940
|
+
* This function gives the grid values of one param, in increasing order. An `enum` gives its values, and a `bool` gives `false` and `true`.
|
|
941
|
+
* With 1 level, a numeric param gives its default. With k levels, it gives k points from `min` to `max` on its scale and step, without repeats.
|
|
942
|
+
*/
|
|
943
|
+
export declare function paramLevels(param: SpaceParam, levels: number): ParamValue[];
|
|
944
|
+
/**
|
|
945
|
+
* This function gives the count of the grid points of a space, with `levels` levels for each numeric param.
|
|
946
|
+
* It counts only the active params and the combinations that keep the constraints. It gives the meta configs apart.
|
|
947
|
+
*/
|
|
948
|
+
export declare function spaceSize(space: StrategySpace, options: SpaceSizeOptions): SpaceSize;
|
|
949
|
+
/**
|
|
950
|
+
* This function gives configs of a space, in their canonical form. Each config keeps the constraints. The result is deterministic.
|
|
951
|
+
*
|
|
952
|
+
* - The mode `grid` gives each grid point without a meta option, in a stable order. Stages, options and values go in the order of the space.
|
|
953
|
+
* - The mode `sample` gives `n` configs of a seeded Latin hypercube. The options of a stage get equal strata, and each active param gets its own strata.
|
|
954
|
+
* - A sample draws again when a point breaks a constraint. After `maxTries` draws, it throws an `Error`. Two sampled configs can be equal.
|
|
955
|
+
*/
|
|
956
|
+
export declare function enumerateSpace(space: StrategySpace, options: EnumerateOptions): StrategyConfig[];
|
|
957
|
+
/**
|
|
958
|
+
* This function joins configs of the parts of a product space into one config of the space `space`.
|
|
959
|
+
* The name of each stage gets the prefix `<space of the part>.`. The members of a meta option do not change.
|
|
960
|
+
*/
|
|
961
|
+
export declare function joinConfigs(space: string, parts: readonly StrategyConfig[]): StrategyConfig;
|
|
962
|
+
/** This function gives the config of the part `engine` of a joint config. It throws a `RangeError` when no stage has the prefix `<engine>.`. */
|
|
963
|
+
export declare function splitConfig(config: StrategyConfig, engine: string): StrategyConfig;
|
|
964
|
+
/**
|
|
965
|
+
* This function joins two spaces, for example a packer and a router, into the space `name`. The stages of `a` and `b` get the prefixes `<a.engine>.` and `<b.engine>.`.
|
|
966
|
+
* The constraints get the same prefixes. The named configs are the pairs `<name of a>+<name of b>`. It throws a `RangeError` when the two engines have the same name.
|
|
967
|
+
*/
|
|
968
|
+
export declare function productSpace(a: StrategySpace, b: StrategySpace, name: string): StrategySpace;
|
|
700
969
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/geometry.ts","../src/tolerance.ts","../src/input.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/measures.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts"],"mappings":";YACY;;qBAGC,gBAAgB;iBAEZ;WACN;WACA;;;iBAIM;WACN;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;;;;;;YAOC;WACG;WAAuB;WAAoB;WAAoB;WAAoB;;WAEnF;WACA;WACA;;WAEA;WAAyB;WAAqB;WAAqB;;WACnE;WAA0B;WAAqB;WAAqB;WAAqB;;;YAG5F,kBAAkB;;wBAGd,YAAY,QAAQ,qBAAqB;;wBAOzC,KAAK,MAAM,MAAM,QAAQ,qBAAqB;;wBAM9C,SAAS,QAAQ,SAAS;;wBAyB1B,UAAU,QAAQ,QAAQ,YAAY,aAAa;;;;;wBAoBnD,UAAU,GAAG,MAAM,GAAG;WAAkB;WAAoB;;;qBCtG/D;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;;;;;iBCvBf;WACN;WACA,OAAO;WACP;WACA;;;iBAIM;WACN;WACA;WACA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KN;;;;;;;;;;;wBAuCK,WAAW,gBAAgB,UAAS;;;;;wBAQpC,aAAa,aAAa,UAAS;;iBAMlC;;WAEN;;WAEA;;;;;;;;wBASK,aAAa,QAAQ,SAAS,qCAAqC;;iBAqBlE;;WAEN,QAAQ,SAAS;;WAEjB;;WAEA;;;;;;;;wBASK,UAAU,UAAU;;YCzLxB,WAAW,KAAK;;iBAGX,OAAO,GAAG;WAChB;;EAET,IAAI,OAAO,IAAI;;;iBAIA,eAAe,GAAG;;WAExB;WACA,MAAM;;EAEf,MAAM,OAAO,GAAG,QAAQ;;;iBAIT,aAAa,GAAG;;EAE/B,KAAK,OAAO,GAAG,QAAQ;;WAEd,iBAAiB,eAAe,GAAG;;EAE5C,MAAM,QAAQ;;;iBAIC;;WAEN;;WAEA;;WAEA;;;;;WAKA;;;YAIC;;iBAGK;WACN;WACA,QAAQ;;WAER,SAAS,SAAS;;WAElB;;;;;WAKA;;WAEA;;;iBAIM;;WAEN,kBAAkB;WAClB;;WAEA;;WAEA;;WAEA;WACA;WACA;;WAEA;;WAEA;;WAEA;;;iBAIM,cAAc;WACpB,QAAQ;WACR;WACA,OAAO;;;iBAID,UAAU,GAAG,WAAW,OAAO,GAAG;;EAEjD,KAAK,OAAO,IAAI,cAAc;;;iBAIf;WACN;WACA,QAAQ,SAAS;;;iBAIX;WACN;WACA,MAAM;;;iBAIA;WACN;;WAEA;;;;;;;;;;;;;;;wBAgBK,WAAW,qBAAqB,mBAAmB,iBAAiB,gBAAgB;;wBAsBpF,UAAU,OAAO,KAAK;EAA8B;;;;;;;;;;;;;;wBAwCpD,UAAU,GAAG,GAC3B,YACA,kBAAkB,OAAO,GAAG,SAAS,OAAO,eAAe,OAAO,GAAG,OACrE,KAAK,aAAa,GAAG,IACrB,UAAS,mBACR,UAAU,GAAG"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/geometry.ts","../src/tolerance.ts","../src/input.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/measures.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/corpus.ts","../src/strategy-space.ts"],"mappings":";YACY;;qBAGC,gBAAgB;iBAEZ;WACN;WACA;;;iBAIM;WACN;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;;;;;;YAOC;WACG;WAAuB;WAAoB;WAAoB;WAAoB;;WAEnF;WACA;WACA;;WAEA;WAAyB;WAAqB;WAAqB;;WACnE;WAA0B;WAAqB;WAAqB;WAAqB;;;YAG5F,kBAAkB;;wBAGd,YAAY,QAAQ,qBAAqB;;wBAOzC,KAAK,MAAM,MAAM,QAAQ,qBAAqB;;wBAM9C,SAAS,QAAQ,SAAS;;wBAyB1B,UAAU,QAAQ,QAAQ,YAAY,aAAa;;;;;wBAoBnD,UAAU,GAAG,MAAM,GAAG;WAAkB;WAAoB;;;qBCtG/D;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;;;;;iBCvBf;WACN;WACA,OAAO;WACP;WACA;;;iBAIM;WACN;WACA;WACA;;WAEA;WACA;;WAEA;;WAEA;WACA;WACA;;WAEA,QAAQ;WACR,iBAAiB;;WAEjB,SAAS;;WAET;;WAEA,OAAO,SAAS;;;YAIf,OAAO;;iBAGF;WACN;WACA;WACA;WACA;WACA;WACA,OAAO,SAAS;;;iBAIV;WACN;WACA;WACA;;WAEA;;WAEA;;WAEA,QAAQ;;WAER;;;iBAIM;WACN;WACA,QAAQ;WACR;aAAkB;;;;iBAIZ;WACN;WACA;WACA,QAAQ,SAAS;WACjB;;;iBAIM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA,YAAY;;WAEZ,iBAAiB;WACjB,OAAO;;WAEP;;WAEA,YAAY;;WAEZ;WACA,gBAAgB;WAChB,iBAAiB;WACjB,qBAAqB;;;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