custom-permutation 1.0.4 → 1.0.7
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
CHANGED
|
@@ -1,27 +1,47 @@
|
|
|
1
|
+
# Fixed bugs
|
|
2
|
+
25.09.2023 - unChoices did not reflect always, fixed now.
|
|
3
|
+
|
|
1
4
|
# Custom Permutation Generator
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
## 1. require / import
|
|
7
|
+
```ts
|
|
8
|
+
const CustomPermutation = require('custom-permutation')
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 2. Constructor
|
|
12
|
+
```ts
|
|
4
13
|
CustomPermutation(elList:[els...], choices:{ index: [els...]] }, nonChoices:{ index: [els...]] })
|
|
5
14
|
```
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
`CustomPermutation(['a', 'b', 'c'], {1: ['a', 'b']}, {0: ['a']})`
|
|
16
|
+
## 3. Usage explanation
|
|
9
17
|
|
|
10
|
-
|
|
18
|
+
_example:_
|
|
11
19
|
|
|
12
|
-
|
|
20
|
+
```ts
|
|
21
|
+
CustomPermutation(['a', 'b', 'c'], {1: ['a', 'b']}, {0: ['a']})
|
|
22
|
+
```
|
|
13
23
|
|
|
14
|
-
|
|
24
|
+
Permutate 3 elements which are 'a', 'b' and 'c' with below rules
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
__- choices rule:__
|
|
27
|
+
```json
|
|
28
|
+
{ 1: ['a', 'b'] }
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
At index=1 there can only be the element 'a' or 'b'
|
|
17
32
|
|
|
18
|
-
|
|
33
|
+
__- nonChoices rule:__
|
|
34
|
+
```json
|
|
35
|
+
{ 0: ['a'] }
|
|
36
|
+
```
|
|
19
37
|
|
|
20
|
-
|
|
38
|
+
At index=0 there can NOT be the element 'a'
|
|
21
39
|
|
|
22
|
-
|
|
40
|
+
_Note: given index are considered as 0 based: [index=0, index=1, etc.]_
|
|
23
41
|
|
|
24
|
-
|
|
42
|
+
## 4. Result set explanation:
|
|
43
|
+
|
|
44
|
+
Let's see all permutations, and which ones are valid or not.
|
|
25
45
|
- `['a', 'b', 'c']` : violates nonChoices rule: _first element is `'a'`, but shouldn't be `'a'`
|
|
26
46
|
- `['a', 'c', 'b']` : violates nonChoices rule: _first element is `'a'`, but shouldn't be `'a'`_
|
|
27
47
|
- `['b', 'a', 'c']` : ok
|
|
@@ -29,32 +49,57 @@ Let's see all permutations, and which ones are valid and not.
|
|
|
29
49
|
- `['c', 'a', 'b']` : ok
|
|
30
50
|
- `['c', 'b', 'a']` : ok
|
|
31
51
|
|
|
32
|
-
So there
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
So there are just 3 results that should be generated with this parameters.
|
|
53
|
+
|
|
54
|
+
## 5. Complete example
|
|
55
|
+
|
|
56
|
+
### 1. Create permutation
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
let customPerm = new CustomPermutation(
|
|
60
|
+
['a', 'b', 'c'],
|
|
61
|
+
{ 1: ['a', 'b'] },
|
|
62
|
+
{ 0: ['a'] }
|
|
63
|
+
);
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 2. Get next value
|
|
67
|
+
|
|
68
|
+
#### 2.1. Use with next
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
let next = customPerm.next();
|
|
72
|
+
|
|
73
|
+
while (next) {
|
|
74
|
+
// Use next
|
|
75
|
+
console.log(next)
|
|
76
|
+
|
|
77
|
+
// Get next
|
|
78
|
+
next = customPerm.next();
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### 2.2. Or use with generator
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
let generator = customPerm.generator();
|
|
86
|
+
let next = generator.next();
|
|
87
|
+
|
|
88
|
+
while (!next.done) {
|
|
89
|
+
// Use next.value
|
|
90
|
+
console.log(next.value)
|
|
91
|
+
|
|
92
|
+
// Generate next one
|
|
93
|
+
next = generator.next();
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 3. Output
|
|
98
|
+
|
|
99
|
+
__Console__
|
|
100
|
+
|
|
101
|
+
```sh
|
|
58
102
|
['b', 'a', 'c']\
|
|
59
103
|
['c', 'a', 'b']\
|
|
60
|
-
['c', 'b', 'a']
|
|
104
|
+
['c', 'b', 'a']
|
|
105
|
+
```
|
|
@@ -9,7 +9,6 @@ var CustomPermutationGenerator = /** @class */ (function () {
|
|
|
9
9
|
elementsOrderAbs, // Actual orders in final schdule
|
|
10
10
|
elementsIndexRel, // Actual relative orders in sub-schedule
|
|
11
11
|
passFunction, randomizechoices) {
|
|
12
|
-
var _this = this;
|
|
13
12
|
if (choicesByIndex === void 0) { choicesByIndex = {}; }
|
|
14
13
|
if (nonChoicesByIndex === void 0) { nonChoicesByIndex = {}; }
|
|
15
14
|
if (elementsIndexRel === void 0) { elementsIndexRel = []; }
|
|
@@ -50,13 +49,13 @@ var CustomPermutationGenerator = /** @class */ (function () {
|
|
|
50
49
|
this.extendIndexesOfSameElements(this.choicesByIndex, indexesOfSameElements);
|
|
51
50
|
// not make for choicesByIndex list so that options be little
|
|
52
51
|
this.extendIndexesOfSameElements(this.nonChoicesByIndex, indexesOfSameElements);
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
// let choicesByIndexInSetFiltered = Object.keys(this.choicesByIndexInSet).filter(x => elementsIndexRel.indexOf(Number(x)) >= 0)
|
|
53
|
+
// .map(x => this.choicesByIndexInSet[x]);
|
|
55
54
|
// Same like above
|
|
56
55
|
// for(let i = 0; i < this.elementsIndexRel.length; i++) {
|
|
57
56
|
// choicesByIndexInSetFiltered[i] = this.choicesByIndexInSet[elementsIndexRel[i]]
|
|
58
57
|
// }
|
|
59
|
-
this.permutationGenOfSet = new PermutationGeneratorForSet_1.PermutationGeneratorForSet(elementList, indexList,
|
|
58
|
+
this.permutationGenOfSet = new PermutationGeneratorForSet_1.PermutationGeneratorForSet(elementList, indexList, this.choicesByIndexInSet, indexesOfSameElements, elementsOrderAbs, passFunction, randomizechoices);
|
|
60
59
|
}
|
|
61
60
|
// collect indexes of same elements into nonChoicesByIndex array, eg, slot1 should be placed by person 1 whose indexes are 3,4,5
|
|
62
61
|
CustomPermutationGenerator.prototype.extendIndexesOfSameElements = function (choicesByIndex, indexesOfSameElements) {
|
|
@@ -119,8 +118,6 @@ var CustomPermutationGenerator = /** @class */ (function () {
|
|
|
119
118
|
indexes = indexes.filter(function (x) { return indexesToRemove.indexOf(x) < 0; });
|
|
120
119
|
}
|
|
121
120
|
_this.choicesByIndexInSet[key] = indexes;
|
|
122
|
-
// ? OR
|
|
123
|
-
// this.choicesByIndex[key] = indexes; // but not working
|
|
124
121
|
});
|
|
125
122
|
};
|
|
126
123
|
CustomPermutationGenerator.prototype.getAllIndexesOfElementInList = function (el, list) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPermutationGenerator.js","sourceRoot":"","sources":["../src/CustomPermutationGenerator.ts"],"names":[],"mappings":";;;AAAA,2EAA0E;AAG1E;IAYE,mIAAmI;IACnI,oCAAoB,WAAkB,EAC5B,cAA2B,EAAE,6FAA6F;IAC1H,iBAA8B,EAAE,8BAA8B;IAC9D,gBAAwB,EAAE,iCAAiC;IAC3D,gBAA4B,EAAE,yCAAyC;IACvE,YAAuB,EACvB,gBAA0B;
|
|
1
|
+
{"version":3,"file":"CustomPermutationGenerator.js","sourceRoot":"","sources":["../src/CustomPermutationGenerator.ts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AAC;AAAD,CAAC,AA/QD,IA+QC;AA/QY,gEAA0B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "custom-permutation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Permutation generator with custom options.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
11
11
|
"lint": "tslint -p tsconfig.json",
|
|
12
12
|
"prepare": "npm run build",
|
|
13
|
-
"prepublishOnly": "npm test",
|
|
14
|
-
"preversion": "",
|
|
13
|
+
"prepublishOnly": "npm test && npm run preversion",
|
|
14
|
+
"preversion": "true || npm run lint",
|
|
15
15
|
"version": "npm run format && git add -A src",
|
|
16
16
|
"postversion": "git push && git push --tags"
|
|
17
17
|
},
|