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

All Known Implementing Classes:
HardLocationImpl

public interface HardLocation

Implementers of this interface are basic components of SDM. A HardLocation has a unique address that consists of a BitVector of the size of the space. 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()
           
 byte[] getCounters()
          Returns the counters of this HardLocation Each HardLocation has wordSize counters.
 int getWriteCount()
           
 int hammingDistance(cern.colt.bitvector.BitVector vector)
          Returns the Hamming distance between vector and the address of this HardLocation
 int[] read(int[] buffer)
          This method reads this HardLocation and sums the reading vector to int[] buffer.
 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 BitVector word to this HardLocation.
 

Method Detail

getAddress

cern.colt.bitvector.BitVector getAddress()
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 address to set

getCounters

byte[] getCounters()
Returns the counters of this HardLocation Each HardLocation has wordSize counters. Each counter is byte size. Couters 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()
Returns:
the number of times that this HardLocation was written.

write

void write(cern.colt.bitvector.BitVector word)
Writes BitVector word 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)
This method reads this HardLocation and sums the reading vector to int[] buffer.

Parameters:
buffer - buffer to be added to this hardlocation
Returns:
summed vector

hammingDistance

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

Parameters:
vector - vector to compare with this hardlocation
Returns:
the Hamming distance.