Skip to content

Commit

Permalink
v0.1.67
Browse files Browse the repository at this point in the history
  • Loading branch information
REllEK-IO committed May 14, 2024
1 parent f9fbb29 commit 07ff8f0
Show file tree
Hide file tree
Showing 21 changed files with 43 additions and 27 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ When in doubt simplify.
* [Unified Turing Machine](https://github.com/Phuire-Research/Stratimux/blob/main/The-Unified-Turing-Machine.md) - The governing concept for this entire framework.

## Change Log ![Tests](https://github.com/Phuire-Research/Stratimux/actions/workflows/node.js.yml/badge.svg)
### **BREAKING** v0.1.66 5/13/2024
### **BREAKING** v0.1.67 5/13/2024
* Revamped the Action Creator Functions to follow behind the current creator with an **options** parameter design choice.
* Note pure action creators will not provide an option for payload
* Cascaded priority to ActionStrategies to allow for planning priority ahead of time.
* Updated the PrincipleFunction documentation to have the semaphore parameter to now be conceptSemaphore. This allows for an easy drop in into the options parameter.
* Made createAxium utilize the same **options** design pattern.
### v0.1.65 5/13/2024
* Removed one more level of deepness from DotPath(6 levels now), projects should now compile without the excessively deep error.
### v0.1.64 5/13/2024
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "stratimux",
"license": "GPL-3.0",
"version": "0.1.66",
"version": "0.1.67",
"description": "Unified Turing Machine",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
9 changes: 8 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ export {
debounceAction,
throttleAction
} from './model/actionOperators';
export type { Action, ActionType, ActionCreator, ActionCreatorWithPayload } from './model/action';
export type {
Action,
ActionType,
ActionCreator,
ActionCreatorWithPayload,
ActionOptions,
ActionWithPayloadOptions
} from './model/action';
export {
primeAction,
createAction,
Expand Down
16 changes: 12 additions & 4 deletions src/model/axium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,20 @@ export const defaultMethodSubscription = (concepts: Concepts, tail: Action[], ac
export function createAxium(
name: string,
initialConcepts: Concept[],
logging?: boolean,
storeDialog?: boolean,
logActionStream?: boolean
options?: {
logging?: boolean,
storeDialog?: boolean,
logActionStream?: boolean
}
): Axium {
const concepts: Concepts = {};
const init = [createAxiumConcept(name, storeDialog, logging, logActionStream), ...initialConcepts];
const init = [
createAxiumConcept(
name,
options?.storeDialog,
options?.logging,
options?.logActionStream
), ...initialConcepts];
init.forEach((concept, i) => {
concept.semaphore = i;
concepts[i] = concept;
Expand Down
2 changes: 1 addition & 1 deletion src/test/addConcepts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { createStage } from '../model/stagePlanner';
import { axiumSelectOpen } from '../concepts/axium/axium.selector';

test('Axium add Concepts Strategy Test', (done) => {
const axium = createAxium('axiumAddConceptTest',[], true, true);
const axium = createAxium('axiumAddConceptTest',[], {logging: true, storeDialog: true});
const plan = axium.plan('Add Concepts Stage',[
createStage((concepts, dispatch) => {
console.log('Add Counter Concept');
Expand Down
2 changes: 1 addition & 1 deletion src/test/asynchronousRecursion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { createStage, stageWaitForOpenThenIterate } from '../model/stagePlanner'
test('Asynchronous recursion', (done) => {
const list = ['This', 'list', 'will', 'deplete', 'to', 'control', 'recursion', 'and', 'be', 'halting', 'complete'];
const experiment = createExperimentConcept(createExperimentState(), [experimentRecurseIterateIdQuality]);
const axium = createAxium('Experiment async method creator with Concepts', [experiment], false, true);
const axium = createAxium('Experiment async method creator with Concepts', [experiment], {storeDialog: true});
const plan = axium.plan('Experiment debounce add one', [
stageWaitForOpenThenIterate(() => axiumKick()),
createStage((_, dispatch) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/chain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { counterSubtract } from '../concepts/counter/qualities/subtract.quality'
import { chainEnd } from '../concepts/chain/qualities/chainEnd.quality';

test('Axium Test', (done) => {
const axium = createAxium('chainConceptTest', [createCounterConcept(), createChainConcept()], true, true);
const axium = createAxium('chainConceptTest', [createCounterConcept(), createChainConcept()], {logging: true, storeDialog: true});
let count = 0;
let willDispatch = true;
const sub = axium.subscribe((concepts: Concepts) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/conceptToString.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { createCounterConcept } from '../concepts/counter/counter.concept';
import { conceptsToString } from '../model/concept';

test('Axium Counting Strategy Test', (done) => {
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], true, true);
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], {logging: true, storeDialog: true});
const sub = axium.subscribe(concepts => {
console.log('CONCEPTS:', conceptsToString(concepts));
expect(true).toBe(true);
Expand Down
2 changes: 1 addition & 1 deletion src/test/onChange.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('Axium onChange Test', (done) => {
[axiumSelectLastStrategy.keys]: (concepts: Concepts) =>
console.log('CHECK: ', selectSlice(concepts, axiumSelectLastStrategy))
};
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], true, true);
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], {logging: true, storeDialog: true});
const plan = axium.plan('Counting Strategy Plan with selectors',
[
createStage((concepts, dispatch) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ownership.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test('Ownership Test', (done) => {
createOwnershipConcept(),
createCounterConcept(),
createExperimentConcept(createExperimentState(), [experimentCheckInStrategyQuality], [experimentActionQuePrinciple])
], true, true);
], {logging: true, storeDialog: true});
const plan = axium.plan(
'Testing Ownership Staging', [
createStage((cpts, dispatch) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/priority/priority.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('Priority Test', (done) => {

const priorityTest = createAxium('Priority Test', [
createExperimentPriorityConcept()
], true, true, true);
], {logging: true, storeDialog: true, logActionStream: true});

const firstStage = (name: string, priority: number) => createStage((concepts, dispatch, changes) => {
const priorityState = select.state<ExperimentPriorityState>(concepts, experimentName);
Expand Down
2 changes: 1 addition & 1 deletion src/test/priority/priorityAction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test('Priority Action Test', (done) => {

const priorityTest = createAxium('Priority Test', [
createExperimentPriorityConcept()
], true, true, true);
], {logging: true, storeDialog: true, logActionStream: true});

const firstStage = (name: string, priority: number) => createStage((concepts, dispatch, changes) => {
const priorityState = select.state<ExperimentPriorityState>(concepts, experimentName);
Expand Down
2 changes: 1 addition & 1 deletion src/test/random/random.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { axiumKick } from '../../concepts/axium/qualities/kick.quality';
import { createStage, stageWaitForOpenThenIterate } from '../../model/stagePlanner';

test('Axium Counting Strategy Test', (done) => {
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], true, true);
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], {logging: true, storeDialog: true});
let strategyTopic = 'SOME STRATEGY TOPIC';
let expectedOutput = 0;
let totalExpected = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/test/removeConcepts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { createStage, stageWaitForOpenThenIterate } from '../model/stagePlanner'
import { axiumKick } from '../concepts/axium/qualities/kick.quality';

test('Axium remove Concepts Strategy Test', (done) => {
const axium = createAxium('axiumRemoveConceptsTest', [createCounterConcept()], true, true);
const axium = createAxium('axiumRemoveConceptsTest', [createCounterConcept()], { logging: true, storeDialog: true });
const plan = axium.plan('Remove Concepts Stage',[
stageWaitForOpenThenIterate(() => axiumKick()),
createStage((concepts, dispatch) => {
Expand Down
4 changes: 2 additions & 2 deletions src/test/selector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test('Axium Selector Test', (done) => {
const counter = createCounterConcept();
const counterState = counter.state as CounterState;
counterState.count = 10;
const axium = createAxium('axiumSelectorTest', [counter], true, true);
const axium = createAxium('axiumSelectorTest', [counter], {logging: true, storeDialog: true});
const sub = axium.subscribe((concepts: Concepts) => {
const state = selectState<CounterState>(concepts, counterName);
console.log('CHECK COUNT', state?.count);
Expand All @@ -28,7 +28,7 @@ test('Axium Selector State Slice Test', (done) => {
const counter = createCounterConcept();
const counterState = counter.state as CounterState;
counterState.count = 10;
const axium = createAxium('axiumSelectorStateSlicedTest', [counter], true, true);
const axium = createAxium('axiumSelectorStateSlicedTest', [counter], {logging: true, storeDialog: true});
axium.subscribe((concepts: Concepts) => {
const count = selectSlice<number>(concepts, counterSelectCount);
expect(count).toBe(10);
Expand Down
6 changes: 3 additions & 3 deletions src/test/setStageOptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { initializeTopic } from '../concepts/axium/strategies/initialization.str

test('Axium setStageSelectors Test', (done) => {
let tally = 0;
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], true, true);
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], {logging: true, storeDialog: true});
const plan = axium.plan('Counting Strategy Plan using setStageSelectors',
[
createStage((concepts, dispatch) => {
Expand Down Expand Up @@ -50,7 +50,7 @@ test('Axium setStageSelectors Test', (done) => {

test('Axium setStageBeat Test', (done) => {
let tally = 0;
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], true, true);
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], {logging: true, storeDialog: true});
const plan = axium.plan('Counting Strategy Plan using setStageBeat',
[
createStage((concepts, dispatch) => {
Expand Down Expand Up @@ -80,7 +80,7 @@ test('Axium setStageBeat Test', (done) => {
});

test('Axium setStagePriority Test', (done) => {
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], true, true);
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], {logging: true, storeDialog: true});
let ready = false;
let tally = 0;
const plan = axium.plan('Counting Strategy Plan using setStagePriority',
Expand Down
2 changes: 1 addition & 1 deletion src/test/stageDispatchOptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { createStage } from '../model/stagePlanner';

test('Axium Stage Dispatch Options Test', (done) => {
let runCount = 0;
const axium = createAxium('axiumStageDispatchOptionsTest', [createCounterConcept()], true);
const axium = createAxium('axiumStageDispatchOptionsTest', [createCounterConcept()], {logging: true});
const sub = axium.subscribe((concepts) => {
const axiumState = concepts[0].state as AxiumState;
if (axiumState.badPlans.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/stagePlannerBeat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('Stage Planner Beat Test', (done) => {
let timerActive = false;
const axium = createAxium('axium test stage planner beat', [
createCounterConcept()
], true, true);
], {logging: true, storeDialog: true});
const beat = 105;
const plan = axium.plan('Stage Planner Beat Test', [
stageWaitForOpenThenIterate(() => axiumKick()),
Expand Down
2 changes: 1 addition & 1 deletion src/test/stagedPrinciple.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ test('Axium Principle Stage', (done) => {
};
createAxium('axiumStrategyTest', [
createExperimentConcept(createExperimentState(), [experimentMockToTrueQuality], [experimentPrinciple])
], true, true);
], {logging: true, storeDialog: true});
});
/*#>*/
2 changes: 1 addition & 1 deletion src/test/strategy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { countingTopic } from '../concepts/counter/strategies/counting.strategy'
import { createStage } from '../model/stagePlanner';

test('Axium Counting Strategy Test', (done) => {
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], true, true);
const axium = createAxium('axiumStrategyTest', [createCounterConcept()], {logging: true, storeDialog: true});
const plan = axium.plan('Counting Strategy Plan',
[
createStage((_, dispatch) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/unifiedSelector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { createStage } from '../model/stagePlanner';
test('Unified Selector Test', (done) => {
const axium = createAxium('Selector Test via Counter', [
createCounterConcept()
], true, true);
], {logging: true, storeDialog: true});
const plan = axium.plan('Plan: Counter Selector', [
createStage((concepts, _) => {
console.log('FIRED!!!');
Expand Down

0 comments on commit 07ff8f0

Please sign in to comment.