/**
 * *****************************************************************************
 * Copyright (c) 2012  DCA-FEEC-UNICAMP
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v3
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl.html
 *
 * Contributors:
 *     K. Raizer, A. L. O. Paraense, R. R. Gudwin - initial API and implementation
 *****************************************************************************
 */
package br.unicamp.cst.attention;

import br.unicamp.cst.core.entities.Codelet;
import br.unicamp.cst.core.entities.MemoryObject;
import br.unicamp.cst.sensory.SensorBufferCodelet;

/**
 * Codelet implementation of Feature Maps generated by the Attentional System of 
 * Conscious Attention-Based Integrated Model (CONAIM). The maps, from a bottom-
 * up perspective, provide information that present saliences in the state to 
 * which attention should be oriented to and that, if attended, will enhance the
 * corresponding region in the attentional map for a certain time and inhibit
 * it in the sequence (inhibition of return). From a top-down perspective, 
 * depending on the system goal and on the attentional dynamic current state 
 * (orienting, selecting or sustaining), voluntary attention can be directed to
 * a region of space or object in two ways: by deliberative enhancing a region
 * in the attentional map or by adjusting the weights that define the 
 * contribution of each feature dimension.
 * 
 * @author L. M. Berto
 * @author L. L. Rossi (leolellisr)
 * @see Codelet
 * @see MemoryObject
 * @see SensorBufferCodelet
 */
public abstract class FeatMapCodelet extends Codelet{
    
    protected MemoryObject featureMap;
    protected String feat_map_name;
    protected double dt = 0.05;
    protected int num_sensors;
    protected int timeWindow;
    protected int mapDimension;
    protected MemoryObject winners;
    public int steps;
    
    /**
     * init FeatMapCodelet

     * @param featmapname
     *          output feature map name
     * @param timeWin
     *          analyzed time window,  Buffer size
     * @param mapDim 
     *          output feature map dimension
     */
    protected FeatMapCodelet(String featmapname,int timeWin, int mapDim){
     
        feat_map_name = featmapname;
        timeWindow = timeWin;
        mapDimension = mapDim;
        steps = 0;
    }
    
    /**
     * Reset triggers.
     */
    public void resetTriggers() {
        steps = 0;
    }
    

    @Override
    /**
     * access MemoryObjects: SensorBuffers and Winners (for top-down perspective) 
     * define output: feat_map_name
     * 
     */
    public abstract void accessMemoryObjects(); 
}
