001    package cnslab.cnsnetwork;
002    
003    import java.io.*;
004    
005    /***********************************************************************
006    * The spike message transmitted between Nethosts.
007    * 
008    * @version
009    *   $Date: 2012-08-04 13:43:22 -0500 (Sat, 04 Aug 2012) $
010    *   $Rev: 104 $
011    *   $Author: croft $
012    * @author
013    *   Yi Dong
014    * @author
015    *   David Wallace Croft
016    ***********************************************************************/
017    public class  NetMessage
018      implements Serializable, Transmissible
019    ////////////////////////////////////////////////////////////////////////
020    ////////////////////////////////////////////////////////////////////////
021    {
022    
023    private static final long  serialVersionUID = 0L;
024    
025    /** From which neuron the spike is generated */
026    public int  from;
027    
028    /** Time of the spike  */
029    public double  time;
030
031    ////////////////////////////////////////////////////////////////////////
032    ////////////////////////////////////////////////////////////////////////
033
034    public  NetMessage (
035      final double  time,
036      final int     from )
037    ////////////////////////////////////////////////////////////////////////
038    {
039      this.time = time;
040      
041      this.from = from;
042    }
043    
044    ////////////////////////////////////////////////////////////////////////
045    ////////////////////////////////////////////////////////////////////////
046    
047    @Override
048    public String  toString ( )
049    ////////////////////////////////////////////////////////////////////////
050    {
051      return "From:" + from + " time:" + time + "\n";
052    }
053    
054    ////////////////////////////////////////////////////////////////////////
055    ////////////////////////////////////////////////////////////////////////
056    }