public static FuzzyPropertiesTO Fill(DrinkTO drinkTo, FuzzyPropertiesTO fuzzyProperties) { if (drinkTo.Soda == Soda.Coke) { fuzzyProperties.StrongCoke = StrongCoke(drinkTo.Coke); fuzzyProperties.SoftCoke = SoftCoke(drinkTo.Coke); fuzzyProperties.WeakCoke = WeakCoke(drinkTo.Coke); fuzzyProperties.StrongPepsi = 0f; fuzzyProperties.SoftPepsi = 0f; fuzzyProperties.WeakPepsi = 0f; } else { fuzzyProperties.StrongPepsi = StrongPepsi(drinkTo.Pepsi); fuzzyProperties.SoftPepsi = SoftPepsi(drinkTo.Pepsi); fuzzyProperties.WeakPepsi = WeakPepsi(drinkTo.Pepsi); fuzzyProperties.StrongCoke = 0f; fuzzyProperties.SoftCoke = 0f; fuzzyProperties.WeakCoke = 0f; } fuzzyProperties.StrongRum = StrongRum(drinkTo.Rum); fuzzyProperties.SoftRum = SoftRum(drinkTo.Rum); fuzzyProperties.WeakRum = WeakRum(drinkTo.Rum); fuzzyProperties.IceCubes = IceCubes(drinkTo.IceCubes); return(fuzzyProperties); }
public static DefuzzyPropertiesTO Fill(DrinkTO drinkTo, FuzzyPropertiesTO fuzzyPropertiesTo, DefuzzyPropertiesTO defuzzyPropertiesTo) { defuzzyPropertiesTo.Soft = Soft(drinkTo, fuzzyPropertiesTo); defuzzyPropertiesTo.Strong = Strong(drinkTo, fuzzyPropertiesTo); defuzzyPropertiesTo.Weak = Weak(drinkTo, fuzzyPropertiesTo); defuzzyPropertiesTo.Taste = GetTaste(defuzzyPropertiesTo); defuzzyPropertiesTo.IsCubaLivre = IsCubaLivre(drinkTo); return(defuzzyPropertiesTo); }
public static bool IsCubaLivre(DrinkTO drinkTo) { if (drinkTo.Soda == Soda.Coke) { return(50f <= drinkTo.Coke && drinkTo.Coke <= 60f && 10f <= drinkTo.Rum && drinkTo.Rum <= 30f && drinkTo.IceCubes == 20f); } else { return(60f <= drinkTo.Pepsi && drinkTo.Pepsi <= 70f && 10f <= drinkTo.Rum && drinkTo.Rum <= 30f && drinkTo.IceCubes == 20f); } }
private static float Weak(DrinkTO drink, FuzzyPropertiesTO fuzzyProperties) { if (drink.Soda == Soda.Coke) { return(Mathf.Max(Mathf.Min(fuzzyProperties.WeakCoke, fuzzyProperties.WeakRum, fuzzyProperties.IceCubes), Mathf.Min(fuzzyProperties.WeakCoke, fuzzyProperties.SoftRum, fuzzyProperties.IceCubes), Mathf.Min(fuzzyProperties.SoftCoke, fuzzyProperties.WeakRum, fuzzyProperties.IceCubes))); } else { return(Mathf.Max(Mathf.Min(fuzzyProperties.WeakPepsi, fuzzyProperties.WeakRum, fuzzyProperties.IceCubes), Mathf.Min(fuzzyProperties.WeakPepsi, fuzzyProperties.SoftRum, fuzzyProperties.IceCubes), Mathf.Min(fuzzyProperties.SoftPepsi, fuzzyProperties.WeakRum, fuzzyProperties.IceCubes))); } }
public static void PrintOnConsole(DrinkTO drinktTo, FuzzyPropertiesTO fuzzyProperties) { if (drinktTo.Soda == Soda.Coke) { Debug.Log("StrongCoke " + fuzzyProperties.StrongCoke); Debug.Log("SoftCoke " + fuzzyProperties.SoftCoke); Debug.Log(string.Format("WeakCoke {0}", fuzzyProperties.WeakCoke)); } else { Debug.Log(string.Format("StrongPepsi {0}", fuzzyProperties.StrongPepsi)); Debug.Log(string.Format("SoftPepsi {0}", fuzzyProperties.SoftPepsi)); Debug.Log(string.Format("WeakPepsi {0}", fuzzyProperties.WeakPepsi)); } Debug.Log("StrongRum " + fuzzyProperties.StrongRum); Debug.Log("SoftRum " + fuzzyProperties.SoftRum); Debug.Log(string.Format("WeakRum {0}", fuzzyProperties.WeakRum)); Debug.Log("IceCubes : " + fuzzyProperties.IceCubes); }
public void Start() { _mixMenu = SceneManager.GetActiveScene() .GetRootGameObjects()[0].transform.Find("Canvas") .Find("MixMenu").gameObject; _sodaMenu = SceneManager.GetActiveScene() .GetRootGameObjects()[0].transform.Find("Canvas") .Find("SodaMenu").gameObject; _advancedResultsMenu = SceneManager.GetActiveScene() .GetRootGameObjects()[0].transform.Find("Canvas") .Find("AdvancedResultsMenu").gameObject; _cokeMixer = new Mixer(_mixMenu.transform.Find("CokeMixer").gameObject, this); _pepsiMixer = new Mixer(_mixMenu.transform.Find("PepsiMixer").gameObject, this); _iceCubesMixer = new Mixer(_mixMenu.transform.Find("IceCubesMixer").gameObject, this); _rumMixer = new Mixer(_mixMenu.transform.Find("RumMixer").gameObject, this); _tasteLbl = _mixMenu.transform.Find("TasteLbl").gameObject.GetComponent <Text>(); _priceLbl = _mixMenu.transform.Find("PriceLbl").gameObject.GetComponent <Text>(); _advancedResultsBtn = _mixMenu.transform.Find("AdvancedResultsBtn").gameObject.GetComponent <Button>(); _strongCokeLbl = _advancedResultsMenu.transform.Find("StrongCokeLbl").gameObject.GetComponent <Text>(); _softCokeLbl = _advancedResultsMenu.transform.Find("SoftCokeLbl").gameObject.GetComponent <Text>(); _weakCokeLbl = _advancedResultsMenu.transform.Find("WeakCokeLbl").gameObject.GetComponent <Text>(); _strongPepsiLbl = _advancedResultsMenu.transform.Find("StrongPepsiLbl").gameObject.GetComponent <Text>(); _softPepsiLbl = _advancedResultsMenu.transform.Find("SoftPepsiLbl").gameObject.GetComponent <Text>(); _weakPepsiLbl = _advancedResultsMenu.transform.Find("WeakPepsiLbl").gameObject.GetComponent <Text>(); _strongRumLbl = _advancedResultsMenu.transform.Find("StrongRumLbl").gameObject.GetComponent <Text>(); _softRumLbl = _advancedResultsMenu.transform.Find("SoftRumLbl").gameObject.GetComponent <Text>(); _weakRumLbl = _advancedResultsMenu.transform.Find("WeakRumLbl").gameObject.GetComponent <Text>(); _iceCubesLbl = _advancedResultsMenu.transform.Find("IceCubesLbl").gameObject.GetComponent <Text>(); _strongLbl = _advancedResultsMenu.transform.Find("StrongLbl").gameObject.GetComponent <Text>(); _softLbl = _advancedResultsMenu.transform.Find("SoftLbl").gameObject.GetComponent <Text>(); _weakLbl = _advancedResultsMenu.transform.Find("WeakLbl").gameObject.GetComponent <Text>(); _tasteLbl2 = _advancedResultsMenu.transform.Find("TasteLbl2").gameObject.GetComponent <Text>(); _priceLbl2 = _advancedResultsMenu.transform.Find("PriceLbl2").gameObject.GetComponent <Text>(); _isCubaLivreLbl = _mixMenu.transform.Find("IsCubaLivreLbl").gameObject.GetComponent <Text>(); _isCubaLivreLbl2 = _advancedResultsMenu.transform.Find("IsCubaLivreLbl2").gameObject.GetComponent <Text>(); _drinkTo = new DrinkTO(); _fuzzyPropertiesTo = new FuzzyPropertiesTO(); _defuzzyPropertiesTo = new DefuzzyPropertiesTO(); }