All Downloads are FREE. Search and download functionalities are using the official Maven repository.

model.MARK_II.generalAlgorithm.SegmentUpdate Maven / Gradle / Ivy

The newest version!
package model.MARK_II.generalAlgorithm;

import model.MARK_II.region.Cell;
import model.MARK_II.region.Synapse;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Quinn Liu ([email protected])
 * @version April 25, 2014
 */
class SegmentUpdate {
    private Set> synapsesWithActiveCells;
    private Set> synapsesWithDeactiveCells;

    /**
     * same as sequenceSegment
     */
    private boolean predictsFeedForwardInputOnNextTimeStep;

    private ColumnPosition neuronColumnPosition;
    private int neuronIndex;

    private Set> synapsesNonexistentInModel;

    public SegmentUpdate(Set> synapsesWithActiveCells,
                         Set> synapsesWithDeactiveCells,
                         ColumnPosition neuronColumnPosition, int neuronIndex) {
        this.synapsesWithActiveCells = synapsesWithActiveCells;
        this.synapsesWithDeactiveCells = synapsesWithDeactiveCells;
        this.predictsFeedForwardInputOnNextTimeStep = false;

        this.neuronColumnPosition = neuronColumnPosition;
        this.neuronIndex = neuronIndex;

        this.synapsesNonexistentInModel = new HashSet>();
    }

    public ColumnPosition getNeuronColumnPosition() {
        return this.neuronColumnPosition;
    }

    public int getNeuronIndex() {
        return this.neuronIndex;
    }

    public Set> getSynapsesWithActiveCells() {
        return this.synapsesWithActiveCells;
    }

    public Set> getSynpasesWithDeactiveCells() {
        return this.synapsesWithDeactiveCells;
    }

    public void setSequenceState(boolean predictsFeedForwardInputOnNextTimeStep) {
        this.predictsFeedForwardInputOnNextTimeStep = predictsFeedForwardInputOnNextTimeStep;
    }

    @Override
    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("\n==========================================");
        stringBuilder.append("\n------------SegmentUpdate Info------------");
        stringBuilder.append("\n          synapsesWithActiveCells size: ");
        stringBuilder.append(this.synapsesWithActiveCells.size());
        stringBuilder.append("\n        synapsesWithDeactiveCells size: ");
        stringBuilder.append(this.synapsesWithDeactiveCells.size());
        stringBuilder.append("\npredictsFeedForwardInputOnNextTimeStep: ");
        stringBuilder.append(this.predictsFeedForwardInputOnNextTimeStep);
        stringBuilder.append("\n    neuronColumnPosition (row, column): (");
        stringBuilder.append(this.neuronColumnPosition.getRow() + ", " + this.neuronColumnPosition.getColumn() + ")");
        stringBuilder.append("\n                           neuronIndex: ");
        stringBuilder.append(this.neuronIndex);
        stringBuilder.append("\n       synapsesNonexistentInModel size: ");
        stringBuilder.append(this.synapsesNonexistentInModel.size());
        stringBuilder.append("\n==========================================");
        String NeuronInformation = stringBuilder.toString();
        return NeuronInformation;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy