template-systems #41

Merged
sebastian merged 30 commits from template-systems into main 2024-04-19 21:10:01 +02:00
8 changed files with 0 additions and 22 deletions
Showing only changes of commit d59534c93e - Show all commits

View File

@ -50,7 +50,6 @@ export class ProductStateEditorComponent implements OnInit{
if(this.templateElement == undefined) { if(this.templateElement == undefined) {
this.datasource.data = this.gamesystem!.states; this.datasource.data = this.gamesystem!.states;
} else if(this.gamesystem instanceof ProductTemplateSystem) { } else if(this.gamesystem instanceof ProductTemplateSystem) {
console.log("Product Template System: ", this.gamesystem!.stateMap.get(this.templateElement))
this.datasource.data = this.gamesystem!.stateMap.get(this.templateElement)! this.datasource.data = this.gamesystem!.stateMap.get(this.templateElement)!
} }

View File

@ -46,7 +46,6 @@ export class SimpleStateEditorComponent implements OnInit{
this.dataSource.filterPredicate = (data: SimpleState, filter: string) => { this.dataSource.filterPredicate = (data: SimpleState, filter: string) => {
return data.stateLabel.toLowerCase().includes(filter); return data.stateLabel.toLowerCase().includes(filter);
} }
console.log(this.templateElement)
} }
editState(state: SimpleState) { editState(state: SimpleState) {

View File

@ -29,7 +29,6 @@ export class IsolatedProductStateGenerator extends ProductSystemGenerator {
protected assignGeneratedStatesAndTransitions(generationResult: ProductGeneratorResult) { protected assignGeneratedStatesAndTransitions(generationResult: ProductGeneratorResult) {
this.productGamesystem.states = this.productGamesystem.states.concat(generationResult.states); this.productGamesystem.states = this.productGamesystem.states.concat(generationResult.states);
console.log("Generation-Result: ", this.productGamesystem.states)
} }
protected generateBinaryIsolatedProductStates(leftSystemData: ProductGenerationData, rightSystemData: ProductGenerationData): ProductGeneratorResult { protected generateBinaryIsolatedProductStates(leftSystemData: ProductGenerationData, rightSystemData: ProductGenerationData): ProductGeneratorResult {

View File

@ -10,16 +10,11 @@ export class IsolatedSymmetricTemplateStateGenerator extends IsolatedTemplateSta
protected generateBinaryIsolatedProductStates(leftSystemData: ProductGenerationData, rightSystemData: ProductGenerationData): ProductGeneratorResult { protected generateBinaryIsolatedProductStates(leftSystemData: ProductGenerationData, rightSystemData: ProductGenerationData): ProductGeneratorResult {
console.log("Calling test")
console.log(leftSystemData.states)
console.log(rightSystemData.states)
const generatedProductStates: ProductState[] = [] const generatedProductStates: ProductState[] = []
leftSystemData.states.forEach(leftState => { leftSystemData.states.forEach(leftState => {
if(leftState.outgoingTransitions.length == 0 && leftState.incomingTransitions.length == 0) { if(leftState.outgoingTransitions.length == 0 && leftState.incomingTransitions.length == 0) {
rightSystemData.states.forEach(rightState => { rightSystemData.states.forEach(rightState => {
console.log("LeftState is isolated")
if(leftState.equals(rightState)) { if(leftState.equals(rightState)) {
if(rightState.outgoingTransitions.length == 0 && rightState.incomingTransitions.length == 0) { if(rightState.outgoingTransitions.length == 0 && rightState.incomingTransitions.length == 0) {
const leftConditions = this.getStateConditions(leftState, true); const leftConditions = this.getStateConditions(leftState, true);
@ -37,7 +32,6 @@ export class IsolatedSymmetricTemplateStateGenerator extends IsolatedTemplateSta
if(!this.contradictCombinedConditions(leftConditions, rightConditions)) { if(!this.contradictCombinedConditions(leftConditions, rightConditions)) {
const generatedState = this.generateBinaryProductState(leftState, rightState, generatedProductStates); const generatedState = this.generateBinaryProductState(leftState, rightState, generatedProductStates);
console.log(generatedProductStates)
} }
} }
}) })

View File

@ -108,7 +108,6 @@ export class ProductSystemGenerator {
this.productGamesystem.states = generationResult.states; this.productGamesystem.states = generationResult.states;
this.productGamesystem.transitions = generationResult.transitions; this.productGamesystem.transitions = generationResult.transitions;
console.log("General ", generationResult.transitions.length)
} }
protected generateBinaryProductTransition(startingState: ProductState, endingState: ProductState, usedTransition: Transition<any>, generatedTransitions: ProductTransition[], leftSystem: boolean) { protected generateBinaryProductTransition(startingState: ProductState, endingState: ProductState, usedTransition: Transition<any>, generatedTransitions: ProductTransition[], leftSystem: boolean) {

View File

@ -28,9 +28,6 @@ export class TemplateProductSystemGenerator extends ProductSystemGenerator {
const productTemplateSystem = this.productGamesystem as ProductTemplateSystem const productTemplateSystem = this.productGamesystem as ProductTemplateSystem
productTemplateSystem.transitionMap.set(this.templateElement, generationResult.transitions) productTemplateSystem.transitionMap.set(this.templateElement, generationResult.transitions)
productTemplateSystem.stateMap.set(this.templateElement, generationResult.states) productTemplateSystem.stateMap.set(this.templateElement, generationResult.states)
console.log("Symmetric", (this.productGamesystem as ProductTemplateSystem).symmetric)
console.log("Template: ", generationResult.transitions.length)
} }
protected getTransitionConditions(transition: Transition<any>, leftSystem: boolean) { protected getTransitionConditions(transition: Transition<any>, leftSystem: boolean) {

View File

@ -36,10 +36,6 @@ export class ProductTemplateSystem extends ProductGamesystem implements Template
if(this.generateIsolatedStates) { if(this.generateIsolatedStates) {
const isolatedTemplateStateGenerator = new IsolatedSymmetricTemplateStateGenerator(this, templateElement); const isolatedTemplateStateGenerator = new IsolatedSymmetricTemplateStateGenerator(this, templateElement);
isolatedTemplateStateGenerator.generateIsolatedProductStates(); isolatedTemplateStateGenerator.generateIsolatedProductStates();
console.log(this.states)
console.log("Generate symmetric isolated states")
} else {
console.log("Do not generate symmetric isolated states")
} }
} else { } else {
const productTemplateGenerator = new TemplateProductSystemGenerator(this, templateElement); const productTemplateGenerator = new TemplateProductSystemGenerator(this, templateElement);

View File

@ -70,8 +70,6 @@ export class CharacterParser {
state.conditionMap.set(character, conditions) state.conditionMap.set(character, conditions)
state.initialMap.set(character, stateReference.initialMap) state.initialMap.set(character, stateReference.initialMap)
console.log(state.initialMap)
} }
for(let i=0; i<characterSpecificGamesystem.transitions.length; i++) { for(let i=0; i<characterSpecificGamesystem.transitions.length; i++) {
@ -84,9 +82,6 @@ export class CharacterParser {
transition!.actionMap.set(character, actions); transition!.actionMap.set(character, actions);
transition!.conditionMap.set(character, condititions); transition!.conditionMap.set(character, condititions);
} }
} else {
console.log(this.characterSpecificGamesystems)
console.log("Cannot find system: ", characterSpecificGamesystem.componentName)
} }
return referencedGamesystem; return referencedGamesystem;