Beispiel #1
0
        /**
         * Adds a boolean Profile to the state with the given key. If no Profile exists, a new Profile is created
         * with the corresponding key. If a Profile exists with that key, the Profile is appended onto the end of the Profile.
         * @param key The key corresponding to the state variable.
         * @param profIn The Profile to be added to the boolean Profile.
         */
        public void addValue(StateVarKey <bool> key, HSFProfile <bool> profIn)
        {
            HSFProfile <bool> valueOut;

            if (!Bdata.TryGetValue(key, out valueOut)) // If there's no Profile matching that key, insert a new one.
            {
                Bdata.Add(key, profIn);
            }
            else // Otherwise, add this data point to the existing Profile.
            {
                valueOut.Add(profIn);
            }
        }
Beispiel #2
0
        /**
         * Adds a boolean Profile value pair to the state with the given key. If no Profile exists, a new Profile is created
         * with the corresponding key. If a Profile exists with that key, the pair is appended onto the end of the Profile.
         * Ensure that the Profile is still time ordered if this is the case.
         * @param key The key corresponding to the state variable.
         * @param pairIn The pair to be added to the boolean Profile.
         */
        public void addValue(StateVarKey <bool> key, KeyValuePair <double, bool> pairIn)
        {
            HSFProfile <bool> valueIn = new HSFProfile <bool>(pairIn);
            HSFProfile <bool> valueOut;

            if (!Bdata.TryGetValue(key, out valueOut)) // If there's no Profile matching that key, insert a new one.
            {
                Bdata.Add(key, valueIn);
            }
            else // Otherwise, add this data point to the existing Profile.
            {
                valueOut.Add(pairIn); //TODO: make sure this is ok. was formally iterator.second.data
            }
        }
Beispiel #3
0
        /**
         * Sets the boolean Profile in the state with its matching key. If a Profile is found already under
         * that key, this will overwrite the old Profile.
         * @param key The boolean state variable key that is being set.\
         * @param profIn The boolean Profile being saved.
         */
        public void setProfile(StateVarKey <bool> key, HSFProfile <bool> profIn)
        {
            HSFProfile <bool> valueOut;

            if (!Bdata.TryGetValue(key, out valueOut)) // If there's no Profile matching that key, insert a new one.
            {
                Bdata.Add(key, profIn);
            }
            else   // Otherwise, erase whatever is there, and insert a new one.
            {
                Bdata.Remove(key);
                Bdata.Add(key, profIn);
            }
        }