edu.memphis.ccrg.lida.episodicmemory.sdm
Interface HardLocation

All Known Implementing Classes:
HardLocationImpl

public interface HardLocation

Hard locations are basic components of SparseDistributedMemory. Each has a unique address that consists of a BitVector of size equal to that of the SparseDistributedMemory. It is composed of multiple counters (one for each dimension of the space). A HardLocation can be written to or read from.

Author:
Javier Snaider

Method Summary
 cern.colt.bitvector.BitVector getAddress()
          Gets address
 byte[] getCounters()
          Returns the counters of this HardLocation Each HardLocation has wordSize counters.
 int getWriteCount()
          Gets write count
 int hammingDistance(cern.colt.bitvector.BitVector vector)
          Returns the Hamming distance between a BitVector and the address of this HardLocation
 int[] read(int[] buffer)
          Reads this HardLocation.
 void setAddress(cern.colt.bitvector.BitVector address)
          Sets the address of this HardLocation in the vector space
 void setCounters(byte[] newCounters)
          Sets the counters of this HardLocation Each HardLocation has wordSize counters.
 void write(cern.colt.bitvector.BitVector word)
          Writes specified BitVector to this HardLocation.
 

Method Detail

getAddress

cern.colt.bitvector.BitVector getAddress()
Gets address

Returns:
the address of this HardLocation

setAddress

void setAddress(cern.colt.bitvector.BitVector address)
Sets the address of this HardLocation in the vector space

Parameters:
address - the BitVector address to set

getCounters

byte[] getCounters()
Returns the counters of this HardLocation Each HardLocation has wordSize counters. Each counter is byte size. Counters are incremented or decremented when the memory is written.

Returns:
the counters of this HardLocation

setCounters

void setCounters(byte[] newCounters)
Sets the counters of this HardLocation Each HardLocation has wordSize counters. Each counter is byte size. Counters are incremented or decremented when the memory is written.

Parameters:
newCounters - new counters

getWriteCount

int getWriteCount()
Gets write count

Returns:
the number of times that this HardLocation was written to.

write

void write(cern.colt.bitvector.BitVector word)
Writes specified BitVector to this HardLocation. For each bit in word, the corresponding counter is incremented if the bit is 1 or decremented if the bit is 0.

Parameters:
word - word to be written

read

int[] read(int[] buffer)
Reads this HardLocation. The binary vector read from this hard location is added to the int[] buffer.

Parameters:
buffer - an int[] buffer where the result of the read is added
Returns:
the updated int[] buffer

hammingDistance

int hammingDistance(cern.colt.bitvector.BitVector vector)
Returns the Hamming distance between a BitVector and the address of this HardLocation

Parameters:
vector - BitVector to be compared with this HardLocation
Returns:
the Hamming distance.