亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tsccombinationalim.java

?? Java遺傳算法庫
?? JAVA
字號:
/*
 * BISTIM.java
 *
 * Created on 19 May 2002, 18:56
 */

package jaga.pj.circuits.control;

import jaga.evolve.Evolver;
import jaga.deploy.Deployment;
import jaga.experiment.*;
import jaga.control.StandardInteractionModel;
import jaga.*;
import jaga.pj.circuits.fpgaft.*;
import jaga.pj.circuits.SimulatorLogicElement;
import jaga.pj.circuits.CircuitsLib;

import java.util.Random;
import java.util.Vector;

import islandev.SnapshotPainter;
import islandev.EmptySnapshotPainter;

/** An Interaction Model for evolving circuits with Built-In-Self-Test (BIST)
 * functionality. <p>Implicit
 * incremental evolution is implemented by establishing a priority order on three
 * different fitness evaluations: f_t fitness at main task, f_bpf BIST performance
 * per fault (how many faults are detectable) and f_bpi BIST performance per instance
 * (how many fault - input vector instances are detected correctly).  f_t is set as 
 * the main genotype fitness, the other two are set as properties with the type
 * Double.  If these are set as FullOrderGenotypes then their compareTo method will
 * establish a full order between them suitable for use with rank selection which
 * sorts the population.
 *
 * <p> <b>WARNING:</b> For now a single fault model is assumed.
 * <p> <b>Note:</b> Error output should go high when the circuit deviates from 
 * its normal functioning behaviour, which may not be optimal because it hasn't evolved
 * completely yet.
 *
 * @author  Michael Garvie
 * @version 
 */
public class TSCCombinationalIM extends StandardInteractionModel
{
    // Constant Vars
    protected final int nrZs = 2; // Dual rail assumed
    
    // Config Vars
    protected double threshold = 0.01; // Amount by which fitness must drop to deem a circuit as failing.
    public int pfPriority = 0;
    public int piPriority = 1;
    
    // Variables for finding Z
    protected int EFindStartAt = 0;
    protected int eSize = 8; // was 3 // Length of output data in time steps for minimum detectable raising of Z
    
    // Variable for extracting value of output (kind of inverse of t_setup)
    protected double validChunkProp = 0.2; // Proportion at end of output data used to measure its value.    
    
    //Working Vars
    protected double currMaxF_e = -1;
    protected SingleFaultModel faultModel;
    protected SingleRandomFaultModel srfm = null; // If its randomness, its randomness will need to be controlled
    protected SimulatorFaultyCircuit circuit;
    protected Random rnd = new Random();
        
    /** Creates new BISTIM */
    public TSCCombinationalIM(Evolver evo, Deployment dep, SimulatorFaultyCircuit cir, Experiment exp, SingleFaultModel fm) {
        super( evo, dep, exp );
        circuit = cir;
        faultModel = fm;
        if( faultModel instanceof SingleRandomFaultModel )
        {
            srfm = ( SingleRandomFaultModel ) fm;
        }        
        BISTLib.setGetEMode( BISTLib.E_MODE_DUAL );
    }
    
    public TSCCombinationalIM(Evolver evo, Deployment dep, SimulatorFaultyCircuit cir, Experiment exp, SingleFaultModel fm, int eSize) {
        this( evo, dep, cir, exp, fm );
        this.eSize = eSize;
    }
    
    public TSCCombinationalIM(Evolver evo, Deployment dep, SimulatorFaultyCircuit cir, Experiment exp, SingleFaultModel fm, int eSize, int iss)
    {
        this( evo, dep, cir, exp, fm, eSize );
        inputSampleSeparation = iss;
    }
    
    public TSCCombinationalIM(Evolver evo, Deployment dep, SimulatorFaultyCircuit cir, Experiment exp, SingleFaultModel fm, int eSize, int EFindStartAt, int iss, SnapshotPainter painter)
    {
        this( evo, dep, cir, exp, fm, eSize, iss );
        this.painter = painter;
        this.EFindStartAt = EFindStartAt;
    }
    
    public void evolve()
    {
        super.evolve();
        if( srfm != null )
        {
            srfm.nextRandomSeries(); // Same for all per generation, but != 'tween generations.
        }
        currMaxF_e = -1;
    }
    
    /** Evaluates these individuals using the deployment and experiments and
     * procedure of this model.
     */
    synchronized public double[] evaluate(Genotype[] inds)
    {
        BISTLib.setGetEMode( BISTLib.E_MODE_DUAL ); // Must be also done here because we're not in client's VM until here.
        
        Genotype ind = inds[ 0 ];
        
        //TI//String longStory = "";
        //TI//String shortStory = "";
        //TI//String shortFullStory = "";
        
        // 1) Evaluate Ind with no faults.
        deployment.program( ind );
        SampleData[] input = experiment.generateInput( inputSampleSeparation );
        
        //TI//if( !stateNoise )
        //TI//{
            //TI//circuit.reset();
        //TI//}else
        //TI//{
        circuit.randomReset();
        //TI//}
        
        SampleData[] outputYZ = deployment.run( input );
        int nrYs = outputYZ.length - nrZs;
        SampleData[] outputY = ESLib.getLines( outputYZ, 0, nrYs );
        double f_e = experiment.getFitness( input, outputY );
        
        //TI//if( printWhich >= PRINT_LONG )
        //TI//{
            //TI//longStory += ESLib.sampleDatasToString( input, outputYZ );
        //TI//}
        
        double f_bpf = 0;
        double f_bpi = 0;
        
        boolean mainTaskOK = f_e > currMaxF_e - threshold;
        boolean errDuringNormal = BISTLib.getE( outputYZ, eSize, nrZs, inputSampleSeparation, EFindStartAt );

        // 2) Compute f_b now.
        
        if( mainTaskOK && !errDuringNormal )
        {
            
            //TI//shortStory += "Fit=" + f_e + "E=" + errDuringNormal + " desE=false\n";
            //TI//shortFullStory += shortStory + "\n";
            
            currMaxF_e = Math.max( f_e, currMaxF_e );
            
            // 2.1) Init variables.

            //2a) Check if faults are detected as a whole.  Ie: there exists
            // some input condition for which the fault is detected.  This
            // is per fault detection.

            //boolean[] usedForY = CircuitsLib.getUsed( circuit, nrYs ); // Skipping faults in unused elements.
            boolean[] usedForYZ = CircuitsLib.getUsed( circuit );

            // Per Fault stats:
            int nrFaults = 1; // how many faults tested for 
            int diagFaults = 1; // how many correctly diagnosed, including no faults.

            // 2b) Check if faults are detected at the right moment.  Ie: if
            // at the first moment the circuit gives out a wrong output the
            // error line is high.  This is per instance detection.

            // Per Instance stats:
            int nrInstances = 1; // how many instances tested
            int diagInstances = 1; // how many correctly diagnosed, including no faults.
            
            // Compress No faults output into int array.
            int testLength = input[ 0 ].length();
            int[] noFaultOuts = new int[ testLength ];
            for( int ol = 0; ol < testLength; ol++ )
            {
                noFaultOuts[ ol ] = BISTLib.getSingleOutAt( outputY, ol, 0, inputSampleSeparation );
            }

            // 2.2) Iterate through faults
            faultModel.reset();
            while( faultModel.hasMoreElements() )
            {
                java.awt.Point fPosVal = ( java.awt.Point ) faultModel.nextElement();

                if( usedForYZ[ fPosVal.x ] ) // Skipping faults in unused elements.
                {
                    // 2.2.1) Set Fault
                    circuit.setFault( fPosVal.x, fPosVal.y );

                    //TI//if( !stateNoise )
                    //TI//{
                        //TI//circuit.reset();
                    //TI//}else
                    //TI//{
                    circuit.randomReset();
                    //TI//}

                    // 2.2.2) Run Circuit with Fault.
                    outputYZ = deployment.run( input );
                    outputY = ESLib.getLines( outputYZ, 0, nrYs );

                    boolean desE_f_i = true; // we want all faults to be detectable.
                    boolean E_f_i = false;

                    nrInstances += testLength; // we know how many tests
                    for( int ol = 0; ol < testLength; ol++ )
                    {
                        boolean currE = BISTLib.getE( outputYZ, ol, eSize, nrZs, inputSampleSeparation, EFindStartAt );
                        E_f_i |= currE;
                        
                        if( noFaultOuts[ ol ] == BISTLib.getSingleOutAt( outputY, ol, 0, inputSampleSeparation ) )
                        {   // OK
                            diagInstances++; // doesn't matter if detected or not.
                        }else
                        {   // Failure
                            if( currE )
                            {
                                diagInstances++;
                            }
                        }
                        //TI//int inp = jaga.ESLib.getLine( input, ol );
                        //TI//boolean e = BISTLib.getE( outputYZ, ol, eSize, nrZs, inputSampleSeparation, EFindStartAt );
                        //TI//if( printWhich > PRINT_SHORT_FULL )
                        //TI//{
                        //TI//shortFullStory += "\nIns= " + inp + " NFO= " + noFaultOuts[ ol ];
                        //TI//shortFullStory += " Outs= " + BISTLib.getSingleOutAt( outputY, ol, 0, inputSampleSeparation ) + " desE= " + ( noFaultOuts[ ol ] != BISTLib.getSingleOutAt( outputY, ol, 0, inputSampleSeparation ) );
                        //TI//shortFullStory += " E= " + e;
                        //TI//}
                    }

                    if( E_f_i )
                    {
                        diagFaults++;
                    }
                    nrFaults++;

                    // clear fault
                    circuit.setFault( fPosVal.x, FTLib.NOFAULT );
                    //TI//String thisShortLine = "Fault: Pos=" + fPosVal.x + " Val=" + fPosVal.y + " E=" + E_f_i + " desE=" + desE_f_i;
                    //TI//shortStory += thisShortLine + "\n";
                    //TI//if( printWhich >= PRINT_LONG )
                    //TI//{
                        //TI//longStory += thisShortLine + ESLib.sampleDatasToString( input, outputYZ ) + "\n";
                    //TI//}
                    //TI//shortFullStory += "\n" + thisShortLine + "\n";
                }
            }

            f_bpf = 1d / ( ( nrFaults - diagFaults ) / 25d + 1d );
            f_bpi = 1d / ( ( nrInstances - diagInstances ) / 180d + 1d );
        }       
        ind.setProperty( pfPriority, new Double( f_bpf ) );
        ind.setProperty( piPriority, new Double( f_bpi ) );
        houseWork( ind, f_e );
        double[] rv = { f_e };
        return rv;        
    }
    
    public String toString()
    {
        String narrator = "TSC Combinational Interaction Model with:";
        narrator += "\n  Threshold = " + threshold;
        narrator += "\n  Error Signal = " + BISTLib.getEModeStrings[ BISTLib.getEMode ];
        narrator += "\n  Error Line t_setup = " + EFindStartAt;
        narrator += "\n  Error High Minimum Size = " + eSize;
        narrator += "\n  Fault Model: " + faultModel;
        narrator += "\n  Input Sample Separation: " + inputSampleSeparation;
        narrator += "\n\nExperiment: " + experiment;
        narrator += "\n\nDeployment: " + deployment;
        narrator += "\n\nEvolver: " + evolver;
        narrator += "\n";
        return narrator;
    }
        
    public Genotype getMaxFitness()
    {
        Genotype rv = super.getMaxFitness();
        rv.setProperty( pfPriority, new Double( 1 ) );
        rv.setProperty( piPriority, new Double( 1 ) );
        return rv;
    }    
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
首页国产欧美久久| 高清在线观看日韩| 欧美精品777| 日韩av成人高清| 欧美大肚乱孕交hd孕妇| 久久国产婷婷国产香蕉| 欧美精品一区二区蜜臀亚洲| 国产在线播放一区| 中文字幕二三区不卡| 一本一本大道香蕉久在线精品| 成人欧美一区二区三区白人| 欧洲一区在线电影| 日产国产高清一区二区三区| 欧美精品一区二区三区久久久| 国产九九视频一区二区三区| 中文字幕一区二区5566日韩| 欧美特级限制片免费在线观看| 美女网站在线免费欧美精品| 国产亚洲制服色| 一本久道中文字幕精品亚洲嫩| 亚洲高清视频的网址| 精品久久久久av影院| av在线不卡电影| 视频在线观看一区| 在线观看91精品国产麻豆| 91精品国产综合久久香蕉的特点| 26uuu精品一区二区| 亚洲综合图片区| 国产乱码精品一区二区三区av| 91蜜桃婷婷狠狠久久综合9色| 在线成人小视频| 国产精品美女久久久久久久久久久| 亚洲自拍偷拍欧美| 成人午夜激情片| 国产精品美女久久福利网站| 亚洲日本va在线观看| 欧美美女喷水视频| 粉嫩久久99精品久久久久久夜| 一级中文字幕一区二区| 久久久久久99久久久精品网站| 在线一区二区三区四区五区| 久久99久久久久| 一区二区三区自拍| 国产人妖乱国产精品人妖| 欧美精品在欧美一区二区少妇| 国产成人三级在线观看| 天堂影院一区二区| 亚洲色图在线视频| 久久久精品欧美丰满| 欧美精品xxxxbbbb| 欧美亚洲国产一区二区三区 | 久久久久免费观看| 欧美日韩卡一卡二| 97se亚洲国产综合自在线| 奇米综合一区二区三区精品视频| 亚洲欧美在线aaa| 久久久久亚洲综合| 精品黑人一区二区三区久久| 欧美色图在线观看| 91玉足脚交白嫩脚丫在线播放| 国产尤物一区二区在线| 日韩高清在线不卡| 亚洲bt欧美bt精品777| 国产精品久久久久久久久免费桃花| 精品乱人伦小说| 91精品国产欧美一区二区18| 欧美亚日韩国产aⅴ精品中极品| 91丨porny丨国产入口| 国产精品18久久久久久久久 | 欧美午夜精品久久久久久孕妇| 91麻豆精品91久久久久同性| 成人黄色综合网站| 国产自产视频一区二区三区| 亚洲靠逼com| 日韩一级欧美一级| 成人久久18免费网站麻豆| 亚洲精品乱码久久久久久黑人| 3d成人h动漫网站入口| 91香蕉国产在线观看软件| 国内精品免费**视频| 亚洲18影院在线观看| 色综合久久久久| 99国产精品国产精品久久| 成人午夜碰碰视频| 99国内精品久久| 一本到一区二区三区| 日本道色综合久久| 欧美日韩一区久久| 日韩一区国产二区欧美三区| 欧美巨大另类极品videosbest | 成人午夜碰碰视频| gogo大胆日本视频一区| 91丨porny丨国产入口| 在线免费av一区| 欧美日韩不卡视频| 日韩欧美高清在线| 国产无一区二区| 一区二区三区在线免费播放 | 婷婷成人激情在线网| 欧美激情艳妇裸体舞| 国产日韩高清在线| 夜夜亚洲天天久久| 喷水一区二区三区| 成人午夜精品在线| 欧美午夜电影一区| 精品欧美黑人一区二区三区| 国产精品乱码人人做人人爱| 亚洲三级免费观看| 蜜臀av一区二区三区| 成人污污视频在线观看| 在线观看av不卡| 精品国产一区二区三区av性色| 国产色产综合色产在线视频| 中文字幕在线不卡| 日本成人在线看| 91在线看国产| 日韩欧美国产综合| 亚洲美女屁股眼交3| 久久精品国产色蜜蜜麻豆| 成人av集中营| 这里是久久伊人| 国产精品国产三级国产有无不卡 | 久久国产日韩欧美精品| 成人免费视频国产在线观看| 欧美精品自拍偷拍| 国产精品传媒在线| 麻豆精品在线看| 欧美自拍偷拍一区| 国产午夜精品久久久久久久| 午夜一区二区三区在线观看| 成人高清免费观看| 欧美va日韩va| 日韩精品亚洲专区| 色婷婷综合视频在线观看| 国产亚洲欧美日韩俺去了| 婷婷综合另类小说色区| av中文字幕不卡| 久久久久久久电影| 免费成人在线网站| 欧美日韩黄色一区二区| 亚洲三级在线播放| jizz一区二区| 亚洲国产精品高清| 国产一区二区在线观看视频| 69堂成人精品免费视频| 一区二区免费在线播放| 成人av电影在线网| 久久看人人爽人人| 毛片av一区二区三区| 欧美高清视频www夜色资源网| 中文字幕制服丝袜一区二区三区| 激情综合色丁香一区二区| 69堂成人精品免费视频| 亚洲成人精品一区二区| 色婷婷激情综合| 亚洲人成在线观看一区二区| 不卡视频在线观看| 亚洲色图清纯唯美| 91麻豆免费看| 亚洲精品少妇30p| 91国模大尺度私拍在线视频| 中文字幕一区二区三区在线观看| 国产电影一区在线| 国产偷国产偷亚洲高清人白洁 | 国产精品久久夜| 国产精品夜夜嗨| 久久久亚洲欧洲日产国码αv| 日韩经典中文字幕一区| 91精品国产福利在线观看| 日韩精品一级中文字幕精品视频免费观看 | 欧美aaa在线| 欧美成人三级电影在线| 黑人巨大精品欧美一区| 久久亚区不卡日本| 国产不卡免费视频| 国产精品亲子伦对白| 91香蕉视频mp4| 亚洲一区二区精品久久av| 精品视频123区在线观看| 午夜精品久久久久久久久| 欧美日韩欧美一区二区| 蜜桃精品在线观看| 欧美成人女星排名| 国产精品影音先锋| 中文字幕一区二区三区视频| 在线免费不卡视频| 午夜日韩在线观看| 久久婷婷国产综合国色天香| 国产大陆a不卡| 亚洲免费色视频| 日韩一级欧美一级| 国产精品91xxx| 亚洲美女淫视频| 欧美一级电影网站| 国产精品18久久久久久久网站| 亚洲欧美视频在线观看视频| 欧美性受xxxx黑人xyx性爽| 免费成人在线观看视频| 中文字幕二三区不卡| 欧美精品vⅰdeose4hd|