template-systems #41
@ -0,0 +1,27 @@
|
|||||||
|
import {IsolatedTemplateStateGenerator} from "./IsolatedTemplateStateGenerator";
|
||||||
|
import {ProductGenerationData} from "./ProductGenerationData";
|
||||||
|
import {ProductGeneratorResult} from "./ProductGeneratorResult";
|
||||||
|
import {ProductState} from "../states/ProductState";
|
||||||
|
|
||||||
|
export class IsolatedSymmetricTemplateStateGenerator extends IsolatedTemplateStateGenerator{
|
||||||
|
|
||||||
|
|
||||||
|
protected generateBinaryIsolatedProductStates(leftSystemData: ProductGenerationData, rightSystemData: ProductGenerationData): ProductGeneratorResult {
|
||||||
|
const generatedProductStates: ProductState[] = []
|
||||||
|
leftSystemData.states.forEach(leftState => {
|
||||||
|
if(leftState.outgoingTransitions.length == 0 && leftState.incomingTransitions.length == 0) {
|
||||||
|
rightSystemData.states.forEach(rightState => {
|
||||||
|
if(leftState.equals(rightState) && rightState.outgoingTransitions.length == 0 && rightState.incomingTransitions.length == 0) {
|
||||||
|
const leftConditions = this.getStateConditions(leftState, true);
|
||||||
|
const rightConditions = this.getStateConditions(rightState, true);
|
||||||
|
|
||||||
|
if(!this.contradictCombinedConditions(leftConditions, rightConditions)) {
|
||||||
|
this.generateBinaryProductState(leftState, rightState, generatedProductStates);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return new ProductGeneratorResult(generatedProductStates, []);
|
||||||
|
}
|
||||||
|
}
|
@ -11,6 +11,9 @@ import {
|
|||||||
SymmetricProductTemplateGenerator
|
SymmetricProductTemplateGenerator
|
||||||
} from "../../gamesystems/productSystemGenerator/SymmetricProductTemplateGenerator";
|
} from "../../gamesystems/productSystemGenerator/SymmetricProductTemplateGenerator";
|
||||||
import {IsolatedTemplateStateGenerator} from "../../gamesystems/productSystemGenerator/IsolatedTemplateStateGenerator";
|
import {IsolatedTemplateStateGenerator} from "../../gamesystems/productSystemGenerator/IsolatedTemplateStateGenerator";
|
||||||
|
import {
|
||||||
|
IsolatedSymmetricTemplateStateGenerator
|
||||||
|
} from "../../gamesystems/productSystemGenerator/IsolatedSymmetricTemplateStateGenerator";
|
||||||
|
|
||||||
export class ProductTemplateSystem extends ProductGamesystem implements TemplateGamesystem{
|
export class ProductTemplateSystem extends ProductGamesystem implements TemplateGamesystem{
|
||||||
|
|
||||||
@ -29,6 +32,11 @@ export class ProductTemplateSystem extends ProductGamesystem implements Template
|
|||||||
if(this.symmetric) {
|
if(this.symmetric) {
|
||||||
const symmetricGenerator = new SymmetricProductTemplateGenerator(this, templateElement);
|
const symmetricGenerator = new SymmetricProductTemplateGenerator(this, templateElement);
|
||||||
symmetricGenerator.generateFromChildsystems()
|
symmetricGenerator.generateFromChildsystems()
|
||||||
|
|
||||||
|
if(this.generateIsolatedStates) {
|
||||||
|
const isolatedTemplateStateGenerator = new IsolatedSymmetricTemplateStateGenerator(this, templateElement);
|
||||||
|
isolatedTemplateStateGenerator.generateFromChildsystems();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const productTemplateGenerator = new TemplateProductSystemGenerator(this, templateElement);
|
const productTemplateGenerator = new TemplateProductSystemGenerator(this, templateElement);
|
||||||
productTemplateGenerator.generateFromChildsystems()
|
productTemplateGenerator.generateFromChildsystems()
|
||||||
|
Loading…
Reference in New Issue
Block a user