template-systems #41
@ -50,7 +50,6 @@ export class ProductStateEditorComponent implements OnInit{
 | 
			
		||||
    if(this.templateElement == undefined) {
 | 
			
		||||
      this.datasource.data = this.gamesystem!.states;
 | 
			
		||||
    } 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)!
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -46,7 +46,6 @@ export class SimpleStateEditorComponent implements OnInit{
 | 
			
		||||
    this.dataSource.filterPredicate = (data: SimpleState, filter: string) => {
 | 
			
		||||
      return data.stateLabel.toLowerCase().includes(filter);
 | 
			
		||||
    }
 | 
			
		||||
    console.log(this.templateElement)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  editState(state: SimpleState) {
 | 
			
		||||
 | 
			
		||||
@ -29,7 +29,6 @@ export class IsolatedProductStateGenerator extends ProductSystemGenerator {
 | 
			
		||||
 | 
			
		||||
  protected assignGeneratedStatesAndTransitions(generationResult: ProductGeneratorResult) {
 | 
			
		||||
    this.productGamesystem.states = this.productGamesystem.states.concat(generationResult.states);
 | 
			
		||||
    console.log("Generation-Result: ", this.productGamesystem.states)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  protected generateBinaryIsolatedProductStates(leftSystemData: ProductGenerationData, rightSystemData: ProductGenerationData): ProductGeneratorResult {
 | 
			
		||||
 | 
			
		||||
@ -10,16 +10,11 @@ export class IsolatedSymmetricTemplateStateGenerator extends IsolatedTemplateSta
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  protected generateBinaryIsolatedProductStates(leftSystemData: ProductGenerationData, rightSystemData: ProductGenerationData): ProductGeneratorResult {
 | 
			
		||||
    console.log("Calling test")
 | 
			
		||||
 | 
			
		||||
    console.log(leftSystemData.states)
 | 
			
		||||
    console.log(rightSystemData.states)
 | 
			
		||||
 | 
			
		||||
    const generatedProductStates: ProductState[] = []
 | 
			
		||||
    leftSystemData.states.forEach(leftState => {
 | 
			
		||||
      if(leftState.outgoingTransitions.length == 0 && leftState.incomingTransitions.length == 0) {
 | 
			
		||||
        rightSystemData.states.forEach(rightState => {
 | 
			
		||||
          console.log("LeftState is isolated")
 | 
			
		||||
          if(leftState.equals(rightState)) {
 | 
			
		||||
            if(rightState.outgoingTransitions.length == 0 && rightState.incomingTransitions.length == 0) {
 | 
			
		||||
              const leftConditions = this.getStateConditions(leftState, true);
 | 
			
		||||
@ -37,7 +32,6 @@ export class IsolatedSymmetricTemplateStateGenerator extends IsolatedTemplateSta
 | 
			
		||||
 | 
			
		||||
            if(!this.contradictCombinedConditions(leftConditions, rightConditions)) {
 | 
			
		||||
              const generatedState = this.generateBinaryProductState(leftState, rightState, generatedProductStates);
 | 
			
		||||
              console.log(generatedProductStates)
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
@ -108,7 +108,6 @@ export class ProductSystemGenerator {
 | 
			
		||||
    this.productGamesystem.states = generationResult.states;
 | 
			
		||||
    this.productGamesystem.transitions = generationResult.transitions;
 | 
			
		||||
 | 
			
		||||
    console.log("General ", generationResult.transitions.length)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  protected generateBinaryProductTransition(startingState: ProductState, endingState: ProductState, usedTransition: Transition<any>, generatedTransitions: ProductTransition[], leftSystem: boolean) {
 | 
			
		||||
 | 
			
		||||
@ -28,9 +28,6 @@ export class TemplateProductSystemGenerator extends ProductSystemGenerator {
 | 
			
		||||
    const productTemplateSystem = this.productGamesystem as ProductTemplateSystem
 | 
			
		||||
    productTemplateSystem.transitionMap.set(this.templateElement, generationResult.transitions)
 | 
			
		||||
    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) {
 | 
			
		||||
 | 
			
		||||
@ -36,10 +36,6 @@ export class ProductTemplateSystem extends ProductGamesystem implements Template
 | 
			
		||||
      if(this.generateIsolatedStates) {
 | 
			
		||||
        const isolatedTemplateStateGenerator = new IsolatedSymmetricTemplateStateGenerator(this, templateElement);
 | 
			
		||||
        isolatedTemplateStateGenerator.generateIsolatedProductStates();
 | 
			
		||||
        console.log(this.states)
 | 
			
		||||
        console.log("Generate symmetric isolated states")
 | 
			
		||||
      } else {
 | 
			
		||||
        console.log("Do not generate symmetric isolated states")
 | 
			
		||||
      }
 | 
			
		||||
    } else {
 | 
			
		||||
      const productTemplateGenerator = new TemplateProductSystemGenerator(this, templateElement);
 | 
			
		||||
 | 
			
		||||
@ -70,8 +70,6 @@ export class CharacterParser {
 | 
			
		||||
 | 
			
		||||
        state.conditionMap.set(character, conditions)
 | 
			
		||||
        state.initialMap.set(character, stateReference.initialMap)
 | 
			
		||||
 | 
			
		||||
        console.log(state.initialMap)
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      for(let i=0; i<characterSpecificGamesystem.transitions.length; i++) {
 | 
			
		||||
@ -84,9 +82,6 @@ export class CharacterParser {
 | 
			
		||||
        transition!.actionMap.set(character, actions);
 | 
			
		||||
        transition!.conditionMap.set(character, condititions);
 | 
			
		||||
      }
 | 
			
		||||
    } else {
 | 
			
		||||
      console.log(this.characterSpecificGamesystems)
 | 
			
		||||
      console.log("Cannot find system: ", characterSpecificGamesystem.componentName)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return referencedGamesystem;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user