Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refinement #241

Merged
merged 7 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ When in doubt simplify.
* [Muxified Turing Machine](https://github.com/Phuire-Research/Stratimux/blob/main/The-Muxified-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
### Stratimux 0.2.0 Stealth Roll Out
### QoL
* Broke up complex files into distinguishable parts
* Hooked in deck functionality into method creators properly
### Stratimux 0.2.0-1 Stealth Roll Out
* Introduces type safety throughout your muxiums via a new DECK Interface System
* e: Entry Action
* c: Comparators, uses semaphores to ensure a stringless comparison
* k: Constants, allows you to select individual properties, make new selectors, get the entire state, etc...
* Override + Hard Override - Will wipe out current actions within the Muxiums Action Que System


### Beyond 0.2.0
* Originally intended to release a conversion guide, but due to the degree of changes. The focus has shifted back towards Huirth and supplying an easy means of accessing tutorials and a proper conceptual library.
* With this release will be reverting back to incremental changes and improvements.


Other typescript projects
Expand Down Expand Up @@ -129,7 +129,7 @@ export const createMuXConcept = () => {
);
};
```
### muuXqOfMux.quality.ts
### muXqOfMux.quality.ts
This isolates all the parts necessary for your actions to have impact within this system. Types are a qualitative description of the overall quality. As even though they are not explicitly used within this system. They likewise better inform training data, and likewise act as unique identifiers if you are accessing the action creators directly versus the DECK System.

Internally Stratimux uses semaphores as the method of quality routing within the Muxium. This is to reduce the time complexity of each look up. To further increase the speed of execution of your applications, utilize the supplied DECK Interfaces at each point of entry.
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.2.1",
"version": "0.2.2",
"description": "Muxified Turing Machine",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion src/concepts/chain/chain.concept.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ And would be considered a precursor to ActionStrategy.
$>*/
/*<#*/
import { Action, MuxiumDeck, PrincipleFunction } from '../../index';
import { createConcept } from '../../model/concept';
import { createConcept } from '../../model/concept/concept';
import { chainPrinciple } from './chain.principle';
import { chainEnd } from './qualities/chainEnd.quality';
import { chainPrepareChain } from './qualities/prepareChain.quality';
Expand Down
13 changes: 5 additions & 8 deletions src/concepts/chain/chain.principle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ generate a principle that observes the chain's actionQue and dispatches
those actions in order upon each state notification.
$>*/
/*<#*/
import { Subscriber } from 'rxjs';
import { Concepts } from '../../model/concept';
import { Action } from '../../model/action';
import { PrincipleFunction, registerPrincipleSubscription } from '../../model/principle';
import { ChainPrinciple, ChainQualities, ChainState, chainName } from './chain.concept';
import { selectMuxifiedState } from '../../model/selector';
import { MuxiumDeck, MuxiumState } from '../muxium/muxium.concept';
import { MuxifiedSubject } from '../../model/stagePlanner';
import { Concepts } from '../../model/concept/concept.type';
import { registerPrincipleSubscription } from '../../model/principle';
import { ChainPrinciple, ChainState, chainName } from './chain.concept';
import { selectMuxifiedState } from '../../model/selector/selector';
import { Action } from '../../model/action/action.type';

export const chainPrinciple: ChainPrinciple = ({
observer,
Expand Down
49 changes: 24 additions & 25 deletions src/concepts/chain/qualities/prepareChain.quality.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
/*<$
For the asynchronous graph programming framework Stratimux and Chain Concept,
generate a quality will add actions into the Chain's actionQue state property.
$>*/
/*<#*/
import { Action, AnyAction } from '../../../model/action';
import { createQualityCardWithPayload } from '../../../model/quality';
import { selectPayload } from '../../../model/selector';
import { ChainState } from '../chain.concept';

export type ChainPrepareChainPayload = {
actions: AnyAction[]
}

export const chainPrepareChain = createQualityCardWithPayload<ChainState, ChainPrepareChainPayload>({
type: 'dispatch Actions from Action Que via Payload to be Chained',
reducer: (state, {payload}) => {
return {
actionQue: [
...state.actionQue,
...payload.actions
]
};
}
});
/*<$
For the asynchronous graph programming framework Stratimux and Chain Concept,
generate a quality will add actions into the Chain's actionQue state property.
$>*/
/*<#*/
import { AnyAction } from '../../../model/action/action.type';
import { createQualityCardWithPayload } from '../../../model/quality';
import { ChainState } from '../chain.concept';

export type ChainPrepareChainPayload = {
actions: AnyAction[]
}

export const chainPrepareChain = createQualityCardWithPayload<ChainState, ChainPrepareChainPayload>({
type: 'dispatch Actions from Action Que via Payload to be Chained',
reducer: (state, {payload}) => {
return {
actionQue: [
...state.actionQue,
...payload.actions
]
};
}
});
/*#>*/
83 changes: 42 additions & 41 deletions src/concepts/counter/counter.concept.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
/*<$
For the asynchronous graph programming framework Stratimux generate a Counter Concept that will keep track of a count in its state.
$>*/
/*<#*/
import { counterAdd } from './qualities/add.quality';
import { counterSubtract } from './qualities/subtract.quality';
import { counterSetCount } from './qualities/setCount.quality';
import { Concept, createConcept } from '../../model/concept';
import { counterMultiply } from './qualities/multiply.quality';
export { countingStrategy } from './strategies/counting.strategy';

export type CounterState = {
count: number
}

export const counterName = 'counter';

const initialCounterState: CounterState = {
count: 0
};

const counterQualities = {
counterAdd,
counterSubtract,
counterSetCount,
counterMultiply
};

export type CounterDeck = {
counter: Concept<CounterState, typeof counterQualities>,
};

export type CounterQualities = typeof counterQualities;

export const createCounterConcept = () => {
return createConcept<CounterState, CounterQualities>(
counterName,
initialCounterState,
counterQualities
);
};
/*<$
For the asynchronous graph programming framework Stratimux generate a Counter Concept that will keep track of a count in its state.
$>*/
/*<#*/
import { counterAdd } from './qualities/add.quality';
import { counterSubtract } from './qualities/subtract.quality';
import { counterSetCount } from './qualities/setCount.quality';
import { createConcept } from '../../model/concept/concept';
import { Concept } from '../../model/concept/concept.type';
import { counterMultiply } from './qualities/multiply.quality';
export { countingStrategy } from './strategies/counting.strategy';

export type CounterState = {
count: number
}

export const counterName = 'counter';

const initialCounterState: CounterState = {
count: 0
};

const counterQualities = {
counterAdd,
counterSubtract,
counterSetCount,
counterMultiply
};

export type CounterDeck = {
counter: Concept<CounterState, typeof counterQualities>,
};

export type CounterQualities = typeof counterQualities;

export const createCounterConcept = () => {
return createConcept<CounterState, CounterQualities>(
counterName,
initialCounterState,
counterQualities
);
};
/*#>*/
17 changes: 9 additions & 8 deletions src/concepts/counter/counter.selector.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*<$
For the asynchronous graph programming framework Stratimux and Counter Concept, generate a KeyedSelector for the Counter's count state property.
$>*/
/*<#*/
import { KeyedSelector, createConceptKeyedSelector } from '../../model/selector';
import { CounterState } from './counter.concept';

export const counterSelectCount: KeyedSelector = createConceptKeyedSelector<CounterState>('counter', 'count');
/*<$
For the asynchronous graph programming framework Stratimux and Counter Concept, generate a KeyedSelector for the Counter's count state property.
$>*/
/*<#*/
import { createConceptKeyedSelector } from '../../model/selector/selector';
import { KeyedSelector } from '../../model/selector/selector.type';
import { CounterState } from './counter.concept';

export const counterSelectCount: KeyedSelector = createConceptKeyedSelector<CounterState>('counter', 'count');
/*#>*/
2 changes: 1 addition & 1 deletion src/concepts/counter/qualities/multiply.quality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { defaultMethodCreator } from '../../../model/quality';
import { CounterState } from '../counter.concept';
import { counterSelectCount } from '../counter.selector';
import { createQualityCardWithPayload } from '../../../model/quality';
import { selectPayload } from '../../../model/selector';
import { selectPayload } from '../../../model/selector/selector';

type CounterMultiplyPayload = {
by: number;
Expand Down
52 changes: 26 additions & 26 deletions src/concepts/counter/qualities/setCount.quality.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
/*<$
For the asynchronous graph programming framework Stratimux and Counter Concept,
generate a quality that set the state property count to the new count provided
by the action's payload.
$>*/
/*<#*/
import { defaultMethodCreator } from '../../../model/quality';
import { CounterState } from '../counter.concept';
import { counterSelectCount } from '../counter.selector';
import { selectPayload } from '../../../model/selector';
import { createQualityCardWithPayload } from '../../../model/quality';

export type CounterSetCountPayload = {
newCount: number
}
export const counterSetCount = createQualityCardWithPayload<CounterState, CounterSetCountPayload>({
type: 'Counter set Count',
reducer: (state, {payload}) => {
const {newCount} = payload;
return {
count: newCount
};
},
methodCreator: defaultMethodCreator,
keyedSelectors: [counterSelectCount]
});
/*<$
For the asynchronous graph programming framework Stratimux and Counter Concept,
generate a quality that set the state property count to the new count provided
by the action's payload.
$>*/
/*<#*/
import { defaultMethodCreator } from '../../../model/quality';
import { CounterState } from '../counter.concept';
import { counterSelectCount } from '../counter.selector';
import { selectPayload } from '../../../model/selector/selector';
import { createQualityCardWithPayload } from '../../../model/quality';
export type CounterSetCountPayload = {
newCount: number
}
export const counterSetCount = createQualityCardWithPayload<CounterState, CounterSetCountPayload>({
type: 'Counter set Count',
reducer: (state, {payload}) => {
const {newCount} = payload;
return {
count: newCount
};
},
methodCreator: defaultMethodCreator,
keyedSelectors: [counterSelectCount]
});
/*#>*/
Loading
Loading