001 package edu.jhu.mb.ernst.model.synapse; 002 003 import edu.jhu.mb.ernst.model.*; 004 005 /*********************************************************************** 006 * Direct access implementation of interface MutableSynapse. 007 * 008 * @see 009 * ModulatedSynapseImp 010 * 011 * @version 012 * $Date: 2012-04-15 13:41:48 -0500 (Sun, 15 Apr 2012) $ 013 * $Rev: 8 $ 014 * $Author: croft $ 015 * @author 016 * Yi Dong 017 * @author 018 * David Wallace Croft 019 ***********************************************************************/ 020 public final class MutableSynapseImp 021 implements MutableSynapse 022 //////////////////////////////////////////////////////////////////////// 023 //////////////////////////////////////////////////////////////////////// 024 { 025 026 // This used to be Serializable but I removed it. 027 // If it turns out it is required, I will add it back. 028 029 private int targetNeuronIndex; // previously named "to" 030 031 private byte type; 032 033 private float weight; 034 035 //////////////////////////////////////////////////////////////////////// 036 //////////////////////////////////////////////////////////////////////// 037 038 public MutableSynapseImp ( 039 final int targetNeuronIndex, 040 final byte type, 041 final float weight ) 042 //////////////////////////////////////////////////////////////////////// 043 { 044 this.targetNeuronIndex = targetNeuronIndex; 045 046 this.type = type; 047 048 this.weight = weight; 049 } 050 051 //////////////////////////////////////////////////////////////////////// 052 // accessor methods 053 //////////////////////////////////////////////////////////////////////// 054 055 @Override 056 public int getTargetNeuronIndex ( ) 057 //////////////////////////////////////////////////////////////////////// 058 { 059 return targetNeuronIndex; 060 } 061 062 @Override 063 public byte getType ( ) 064 //////////////////////////////////////////////////////////////////////// 065 { 066 return type; 067 } 068 069 @Override 070 public float getWeight ( ) 071 //////////////////////////////////////////////////////////////////////// 072 { 073 return weight; 074 } 075 076 //////////////////////////////////////////////////////////////////////// 077 // mutator methods 078 //////////////////////////////////////////////////////////////////////// 079 080 @Override 081 public void setTargetNeuronIndex ( final int targetNeuronIndex ) 082 //////////////////////////////////////////////////////////////////////// 083 { 084 this.targetNeuronIndex = targetNeuronIndex; 085 } 086 087 @Override 088 public void setType ( final byte type ) 089 //////////////////////////////////////////////////////////////////////// 090 { 091 this.type = type; 092 } 093 094 @Override 095 public void setWeight ( final float weight ) 096 //////////////////////////////////////////////////////////////////////// 097 { 098 this.weight = weight; 099 } 100 101 //////////////////////////////////////////////////////////////////////// 102 //////////////////////////////////////////////////////////////////////// 103 104 @Override 105 public int compareTo ( final Synapse other ) 106 //////////////////////////////////////////////////////////////////////// 107 { 108 return SynapseLib.compareTo ( this, other ); 109 } 110 111 @Override 112 public String toString ( ) 113 //////////////////////////////////////////////////////////////////////// 114 { 115 return SynapseLib.toString ( this ); 116 } 117 118 //////////////////////////////////////////////////////////////////////// 119 //////////////////////////////////////////////////////////////////////// 120 }