Beispiel #1
0
        /// <summary>
        /// did the other atom occur at the same time as this one?
        /// if so return an atom representing the overlap
        /// </summary>
        /// <param name="other_atom"></param>
        public eventTemporal AtSameTime(eventTemporal other_atom)
        {
            eventTemporal overlap = null;

            if ((this.start_time >= other_atom.start_time) &&
                (this.start_time <= other_atom.end_time))
            {
                overlap = new eventTemporal(this.start_time, other_atom.end_time);
            }

            if ((this.end_time >= other_atom.start_time) &&
                (this.end_time <= other_atom.end_time))
            {
                overlap = new eventTemporal(other_atom.start_time, this.end_time);
            }

            if ((this.start_time >= other_atom.start_time) &&
                (this.end_time <= other_atom.end_time))
            {
                overlap = new eventTemporal(this.start_time, this.end_time);
            }

            if ((other_atom.start_time >= this.start_time) &&
                (other_atom.end_time <= this.end_time))
            {
                overlap = new eventTemporal(this.start_time, this.end_time);
            }

            return(overlap);
        }
Beispiel #2
0
        /// <summary>
        /// did this atom occur after the given one
        /// if so return the time difference
        /// </summary>
        /// <param name="other_atom"></param>
        public TimeSpan After(eventTemporal other_atom)
        {
            TimeSpan time_difference = TimeSpan.Zero;

            if (this.start_time > other_atom.end_time)
                time_difference = this.start_time.Subtract(other_atom.end_time);

            return(time_difference);
        }
Beispiel #3
0
 public nodeTemporal(DateTime start_time, DateTime end_time)
 {
     SetFlag(atom.FLAG_TEMPORAL);
     node_event = new eventTemporal(start_time, end_time);
 }
Beispiel #4
0
 public nodeTemporal()
 {
     SetFlag(atom.FLAG_TEMPORAL);
     node_event = new eventTemporal();
 }
Beispiel #5
0
 /// <summary>
 /// returns the time difference between this and another temporal atom
 /// </summary>
 /// <param name="other_atom"></param>
 public TimeSpan TimeDifference(eventTemporal other_atom)
 {
     TimeSpan time_difference = other_atom.start_time.Subtract(this.end_time);
     return(time_difference);
 }
Beispiel #6
0
        /// <summary>
        /// returns the weight plasticity in the range -1 <= w <= 1 according to an STDP rule
        /// </summary>
        /// <param name="other_atom"></param>
        /// <param name="association_time_period_mS">the time period within which the weight is sensitive to being changed</param>
        public float SpikeTimeDependentPlasticity(eventTemporal other_atom,
		                                          float association_time_period_mS)
        {
            float weight_plasticity = 0;
            const float max_weight_value = 1.0f;

            TimeSpan s = TimeDifference(other_atom);
            if (s.TotalMilliseconds < 0)
                weight_plasticity = max_weight_value * (float)Math.Exp(s.TotalMilliseconds / association_time_period_mS);
            else
                weight_plasticity = max_weight_value * (float)Math.Exp(s.TotalMilliseconds / (association_time_period_mS*2));

            return(weight_plasticity);
        }
Beispiel #7
0
        /// <summary>
        /// did this atom occur before the given one
        /// if so return the time difference
        /// </summary>
        /// <param name="other_atom"></param>
        public TimeSpan Before(eventTemporal other_atom)
        {
            TimeSpan time_difference = TimeSpan.Zero;

            if (this.end_time < other_atom.start_time)
                time_difference = other_atom.start_time.Subtract(this.end_time);

            return(time_difference);
        }