⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testingtesterbistpim.java~

📁 Java遗传算法库
💻 JAVA~
字号:
/* * TestingTesterBISTPIM.java * * Created on 13 June 2003, 11:18 */package jaga.pj.circuits.control;import jaga.SampleData;import jaga.Genotype;import jaga.evolve.Evolver;import jaga.deploy.Deployment;import jaga.experiment.ConfigurableExperiment ;import islandev.SnapshotPainter;/** * * @author  mmg20 */public abstract class TestingTesterBISTPIM extends jaga.control.JobInterviewIM {    // Const    public static final int NR_ROUNDS = 3;    public static final int[] ROUND_TARGETS = { -1, 0, 1 };    protected final int TASK_ROUND = 0, SINGLE_FAULT_ROUND = 1, ALL_FAULTS_ROUND = 2 ;    protected final int DIAGNOSED = 0, TESTED = 1;        // Config    protected Deployment deploy;    protected ConfigurableExperiment exp;    protected int iss;    protected int nrEs;    protected int eSize; // not using etSetup    protected double validChunkProp = 0.2; // Proportion at end of output data used to measure its value.        protected int nrSimFaults; // how many faults at a time max.    protected double defFitFunK;    protected int getEMode = BISTLib.E_HIGH;    protected int startAt = 0;        public TestingTesterBISTPIM( Evolver evo, Deployment deployment, ConfigurableExperiment experiment, double[] thresholds, int sizeOfEHigh, int numOfELines, int roundForAverage, int howManySimultFaults, int startAt, int getEMode, int iss, SnapshotPainter painter )    {        this( evo, deployment, experiment, thresholds, sizeOfEHigh, numOfELines, roundForAverage, howManySimultFaults, painter );        this.startAt = startAt;        this.getEMode = getEMode;        this.iss = iss;    }        public TestingTesterBISTPIM( Evolver evo, Deployment deployment, ConfigurableExperiment experiment, double[] thresholds, int sizeOfEHigh, int numOfELines, int roundForAverage, int howManySimultFaults, SnapshotPainter painter )    {        super( evo, NR_ROUNDS, thresholds, ROUND_TARGETS, painter ); //, roundForAverage );        deploy = deployment;        iss = deploy.getRecommendedInputSampleSeparation();        exp = experiment;        eSize = sizeOfEHigh;        nrEs = numOfELines;        nrSimFaults = howManySimultFaults;        for( int pl = 0; pl < nrSimFaults; pl++ )        {            setFitnessMeasure( fittestPossible, pl, 1d );        }    }        /** Evaluates these individuals using the deployment and experiments and     * procedure of this model.     * @return an array of the fitnesses of the individuals.     */    public double[] evaluate(Genotype[] inds) {        BISTLib.setGetEMode( getEMode );        Genotype ind = inds[ 0 ];        double rv = -1;        deploy.program( ind );        SampleData[] ins = exp.generateInput( iss );                //int maxDepth = Integer.MAX_VALUE;        int maxDepth = nrSimFaults;        double fitFunK = defFitFunK;        int startSettingPropertiesAt = 1;        switch( currRound )        {            case TASK_ROUND:                 for( int dl = 0; dl < nrSimFaults; dl++ )                {                    setFitnessMeasure( ind, dl, 0 );                }                rv = evalTask( ind, ins );                //System.out.println("evaluated task " + rv );            //D                break;            case SINGLE_FAULT_ROUND:                 maxDepth = 1;                fitFunK = 25;            case ALL_FAULTS_ROUND:                int[] undetectedFaults = evalAllFaultCombs( maxDepth, ind, ins );                for( int dl = 0; dl < undetectedFaults.length; dl++ )                {                    double currentFitness = 1d / ( undetectedFaults[ dl ] / fitFunK + 1d );                    setFitnessMeasure( ind, dl, currentFitness );                    if( dl == roundTargets[ currRound ] )                    {                        rv = currentFitness;                    }                }        }        double[] rva = { rv };        houseWork( inds, rva );        return rva;    }        protected abstract double evalTask( Genotype ind, SampleData[] ins );        protected abstract int[] evalAllFaultCombs( int maxDepth, Genotype ind, SampleData[] ins );    public String toString()    {        String rv = "Testing the Tester BIST PIM with:";        rv += "\n  # Error Lines = " + nrEs;        rv += "\n  Error Line Signal Method: " + BISTLib.getEModeStrings[ getEMode ];        rv += "\n  E Size = " + eSize;        rv += "\n  Input Sample Separation = " + iss;        rv += "\n  # Simultaneous Faults = " + nrSimFaults;        rv += "\n  Experiment: " + exp;        rv += "\n  Deployment: " + deploy;        rv += "\n  SuperClass: " + super.toString();        return rv;    }    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -