src/core/WeaponSystem.js
/**
	* Inits the fuzzy module for the blaster.
	*
	* @param {Object} fuzzySets - An object with predefined fuzzy sets.
	* @return {WeaponSystem} A reference to this weapon system.
	*/
Inits the fuzzy module for the blaster.
@param {Object} fuzzySets - An object with predefined fuzzy sets.
@return {WeaponSystem} A reference to this weapon system.
Inits the fuzzy module for the blaster . @param { Object } fuzzySets - An object with predefined fuzzy sets . @return { WeaponSystem } A reference to this weapon system .
_initBlasterFuzzyModule( fuzzySets ) {
		const fuzzyModuleBlaster = this.fuzzyModules.blaster;
		const ammoStatusBlaster = new FuzzyVariable();
		const lowBlaster = new LeftShoulderFuzzySet( 0, 8, 15 );
		const okayBlaster = new TriangularFuzzySet( 8, 20, 30 );
		const LoadsBlaster = new RightShoulderFuzzySet( 20, 30, 48 );
		ammoStatusBlaster.add( lowBlaster );
		ammoStatusBlaster.add( okayBlaster );
		ammoStatusBlaster.add( LoadsBlaster );
		fuzzyModuleBlaster.addFLV( 'ammoStatus', ammoStatusBlaster );
		fuzzyModuleBlaster.addRule( new FuzzyRule( new FuzzyAND( fuzzySets.targetClose, lowBlaster ), fuzzySets.undesirable ) );
		fuzzyModuleBlaster.addRule( new FuzzyRule( new FuzzyAND( fuzzySets.targetClose, okayBlaster ), fuzzySets.desirable ) );
		fuzzyModuleBlaster.addRule( new FuzzyRule( new FuzzyAND( fuzzySets.targetClose, LoadsBlaster ), fuzzySets.desirable ) );
		fuzzyModuleBlaster.addRule( new FuzzyRule( new FuzzyAND( fuzzySets.targetMedium, lowBlaster ), fuzzySets.desirable ) );
		fuzzyModuleBlaster.addRule( new FuzzyRule( new FuzzyAND( fuzzySets.targetMedium, okayBlaster ), fuzzySets.desirable ) );
		fuzzyModuleBlaster.addRule( new FuzzyRule( new FuzzyAND( fuzzySets.targetMedium, LoadsBlaster ), fuzzySets.desirable ) );
		fuzzyModuleBlaster.addRule( new FuzzyRule( new FuzzyAND( fuzzySets.targetFar, lowBlaster ), fuzzySets.desirable ) );
		fuzzyModuleBlaster.addRule( new FuzzyRule( new FuzzyAND( fuzzySets.targetFar, okayBlaster ), fuzzySets.desirable ) );
		fuzzyModuleBlaster.addRule( new FuzzyRule( new FuzzyAND( fuzzySets.targetFar, LoadsBlaster ), fuzzySets.desirable ) );
		return this;
	}
_initBlasterFuzzyModule ( fuzzySets ) { const fuzzyModuleBlaster = this . fuzzyModules . blaster ; const ammoStatusBlaster = new FuzzyVariable ( ) ; const lowBlaster = new LeftShoulderFuzzySet ( 0 , 8 , 15 ) ; const okayBlaster = new TriangularFuzzySet ( 8 , 20 , 30 ) ; const LoadsBlaster = new RightShoulderFuzzySet ( 20 , 30 , 48 ) ; ammoStatusBlaster . add ( lowBlaster ) ; ammoStatusBlaster . add ( okayBlaster ) ; ammoStatusBlaster . add ( LoadsBlaster ) ; fuzzyModuleBlaster . addFLV ( 'ammoStatus' , ammoStatusBlaster ) ; fuzzyModuleBlaster . addRule ( new FuzzyRule ( new FuzzyAND ( fuzzySets . targetClose , lowBlaster ) , fuzzySets . undesirable ) ) ; fuzzyModuleBlaster . addRule ( new FuzzyRule ( new FuzzyAND ( fuzzySets . targetClose , okayBlaster ) , fuzzySets . desirable ) ) ; fuzzyModuleBlaster . addRule ( new FuzzyRule ( new FuzzyAND ( fuzzySets . targetClose , LoadsBlaster ) , fuzzySets . desirable ) ) ; fuzzyModuleBlaster . addRule ( new FuzzyRule ( new FuzzyAND ( fuzzySets . targetMedium , lowBlaster ) , fuzzySets . desirable ) ) ; fuzzyModuleBlaster . addRule ( new FuzzyRule ( new FuzzyAND ( fuzzySets . targetMedium , okayBlaster ) , fuzzySets . desirable ) ) ; fuzzyModuleBlaster . addRule ( new FuzzyRule ( new FuzzyAND ( fuzzySets . targetMedium , LoadsBlaster ) , fuzzySets . desirable ) ) ; fuzzyModuleBlaster . addRule ( new FuzzyRule ( new FuzzyAND ( fuzzySets . targetFar , lowBlaster ) , fuzzySets . desirable ) ) ; fuzzyModuleBlaster . addRule ( new FuzzyRule ( new FuzzyAND ( fuzzySets . targetFar , okayBlaster ) , fuzzySets . desirable ) ) ; fuzzyModuleBlaster . addRule ( new FuzzyRule ( new FuzzyAND ( fuzzySets . targetFar , LoadsBlaster ) , fuzzySets . desirable ) ) ; return this ; }
Inits the fuzzy module for the blaster.
Inits the fuzzy module for the blaster .
// FLV ammo status // rules