Exemplo n.º 1
0
        public List <object> adapt(List <object> env, bool observed)
        {
            if (!observed)
            {
                List <object>     product   = new List <object>();
                MixedState <bool> aliveTemp = MixedState <bool> .convert(Alive);

                Alive = aliveTemp;
                foreach (object thing in env)
                {
                    if (thing is PoisonGas)
                    {
                        product.Add("Oops!");
                        product.Add("@^)$(@*&*#(!");
                        aliveTemp.mix(false);
                        return(product);
                    }
                }
            }
            else
            {
                Alive = MixedState <bool> .toCertain(Alive);
            }
            return(new List <object>());
        }
Exemplo n.º 2
0
        public List <object> adapt(List <object> env, bool observed)
        {
            if (!observed)
            {
                if (checkRadioactive() && random.Next(0, 99999) > 50000)
                {
                    MixedState <bool> radioactiveTemp = MixedState <bool> .convert(IsRadioactive);

                    radioactiveTemp.mix(false);
                    IsRadioactive = radioactiveTemp;
                    return(decay().Variables);
                }
            }
            else
            {
                IsRadioactive = MixedState <bool> .toCertain(IsRadioactive);
            }
            return(new List <object>());
        }