Package org.moltools.apps.probemaker.design

Examples of org.moltools.apps.probemaker.design.DefaultProbeDesigner


    });
      proj.getSettings().getDesignParameters().put(Analyzer.PROP_ACCEPT_OK_ARMS,"false");
      proj.getSettings().getDesignParameters().put(Analyzer.PROP_ACCEPT_OK_CANDIDATES,"false");
     
      //First design, expected to result in failure.
      pm.getProbeDesignTask(false, true, false, new GoodFairAcceptor(), new BestQualitySelector(), new DefaultProbeDesigner(new GreedyTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true)).run();
      Probe p = proj.getProbes().getSequenceAt(0);
              
      assertEquals("Tag allocation should have failed", 0, p.getTags().size());    //$NON-NLS-1$
      assertEquals("Quality expected to be bad", ProbeMakerConstants.BAD_QUALITY, ProbeMakerPropertyUtils.getRank(p));     
     
     
    //New design, with accept OK pairs. Expected to generate candidates, but fail.     
      proj.getSettings().getDesignParameters().put(Analyzer.PROP_ACCEPT_OK_ARMS,"true");
      proj.getSettings().getDesignParameters().put(Analyzer.PROP_ACCEPT_OK_CANDIDATES,"false");
      ProbeDesignTask task = pm.getProbeDesignTask(false, true, false, new GoodFairAcceptor(), new BestQualitySelector(), new DefaultProbeDesigner(new GreedyTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
      task.run();
      long candCount = task.getCandidatesGenerated();
      p = proj.getProbes().getSequenceAt(0);
     
      assertEquals("Tag allocation should have failed", 0, p.getTags().size());    //$NON-NLS-1$
      assertEquals("Candidates expected", libraries1_1[0].size() , candCount);
      assertEquals("Quality expected to be bad", ProbeMakerConstants.BAD_QUALITY, ProbeMakerPropertyUtils.getRank(p));     
     
    //New design, with accept OK pairs AND candidates. Expected to generate candidates, and find candidate with warning.     
      proj.getSettings().getDesignParameters().put(Analyzer.PROP_ACCEPT_OK_ARMS,"true");
      proj.getSettings().getDesignParameters().put(Analyzer.PROP_ACCEPT_OK_CANDIDATES,"true");
      task = pm.getProbeDesignTask(false, true, true, new GoodFairAcceptor(), new BestQualitySelector(), new DefaultProbeDesigner(new GreedyTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
      task.run();
      candCount = task.getCandidatesGenerated();
      p = proj.getProbes().getSequenceAt(0);
      System.out.println("Probe");
      for (Iterator<KeyValue> i = p.getPropertySet().getKeyValueIterator();i.hasNext();) {
View Full Code Here


    proj.getSettings().addCandidateModuleStage1(dummy);

    pm.setProject(proj);

    //Make a new design after clearing tag usage   
    Task task = pm.getProbeDesignTask(false, true, true, new GoodAcceptor(), new NoSelector(), new DefaultProbeDesigner(new GreedyTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
    task.run();
    Probe p = proj.getProbes().getSequenceAt(0);
    assertTrue("Tag allocated despite warning message",p.getTags().size() == 0); //$NON-NLS-1$

    proj.getSettings().getCandidateModulesStage1().clear();
View Full Code Here

    pm.setProject(proj);
   
    dummy.setData(DummyModule.KEY_WARNING_CHANCE, new Integer(100));
    proj.getSettings().addCandidateModuleStage1(dummy);

    ProbeDesignTask task = pm.getProbeDesignTask(false, true, false, new GoodAcceptor(), new NoSelector(), new DefaultProbeDesigner(new GreedyTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
    task.run();

    //Check the number of candidates tested
    long candCount = task.getCandidatesGenerated();  
    assertTrue("Tag selection, 10 candidates expected, " + candCount + " generated.",candCount==10); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    proj.getSettings().getDesignParameters().put(TagAllocator.PROP_PREFERRED_LENGTH,String.valueOf(61));
    proj.getSettings().getDesignParameters().put(TagAllocator.PROP_SPACER_SEQUENCE,"CT");     //$NON-NLS-1$
    pm.setProject(proj);

    GreedyTagAllocator ta = new GreedyTagAllocator();          
    ProbeDesignTask task = pm.getProbeDesignTask(false, true, false, new GoodAcceptor(), new NoSelector(), new DefaultProbeDesigner(ta), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
    //task.addListener(new TaskListener());
    task.run();

    long candCount = task.getCandidatesGenerated();

    //Check the number of candidates tested
    assertEquals("Constant spacer, 10 candidates expected, " + candCount + " generated.", candCount, 10); //$NON-NLS-1$ //$NON-NLS-2$

    proj.getSettings().getDesignParameters().put(TagAllocator.PROP_SPACER_SEQUENCE,""); //$NON-NLS-1$

    ta = new GreedyTagAllocator();
    //ta.setDebug(3,System.out);

    task = pm.getProbeDesignTask(false, true, true, new GoodAcceptor(), new NoSelector(), new DefaultProbeDesigner(ta), new DefaultTSSConstructor() ,new StreamErrorHandler(System.out,true));
    //task.addListener(new TaskListener());
    task.run();

    //Check the number of candidates tested
    candCount = task.getCandidatesGenerated();
View Full Code Here

    proj.getSettings().addCandidateModuleStage1(dummy);
    pm.setProject(proj);

    //Run test to fail all    
    ProbeDesignTask task = pm.getProbeDesignTask(false, true, true, new GoodAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new PairwiseTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));

    task.run();
    long candCount = task.getCandidatesGenerated();

    assertTrue("Pairwise allocation (Stage 1 module), 10 candidates expected, " + candCount + " generated.",candCount == 10); //$NON-NLS-1$ //$NON-NLS-2$

    //Move dummy to arm stage, check that there are no candidates generated
    proj.getSettings().getCandidateModulesStage1().clear();
    proj.getSettings().getArmModules().add(dummy);

    task = pm.getProbeDesignTask(false, true, true, new GoodAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new PairwiseTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
    task.run();   
    candCount = task.getCandidatesGenerated();

    assertTrue("Pairwise allocation (TSS module), 0 candidates expected, " + candCount + " generated.",candCount==0); //$NON-NLS-1$ //$NON-NLS-2$

//  Expand target and test use unique mode, 2 candidates expected
    TargetHandler.expandTargets(pm.getProject().getTargets());
    proj.getSettings().getArmModules().clear();   

    task = pm.getProbeDesignTask(false, true, true, new GoodAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new GreedyTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
    task.run();
    candCount = task.getCandidatesGenerated();
    Probe p1 = pm.getProject().getProbes().getSequenceAt(0);
    Probe p2 = pm.getProject().getProbes().getSequenceAt(1);

    assertTrue("2 candidates expected, " + candCount + " generated.",candCount == 2); //$NON-NLS-1$ //$NON-NLS-2$
    assertTrue("Same tags allocated in unique mode!",p1.getTagAt(0)!=p2.getTagAt(0)); //$NON-NLS-1$

//  Expand target and test use per group, no modules, 2 candidates expected       
    libraries1_10[0].setMode(TagLibrary.USE_PER_GROUP);          

    task = pm.getProbeDesignTask(false, true, true, new GoodAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new GreedyTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
    task.run();
    candCount = task.getCandidatesGenerated();
    p1 = pm.getProject().getProbes().getSequenceAt(0);
    p2 = pm.getProject().getProbes().getSequenceAt(1);

    assertTrue("2 candidates expected, " + candCount + " generated.",candCount == 2); //$NON-NLS-1$ //$NON-NLS-2$
    assertTrue("Different tags allocated in group mode!",p1.getTagAt(0)==p2.getTagAt(0)); //$NON-NLS-1$

//  Still expanded targets, per group mode, greedy allocator, dummy module in stage 1.
    //Expect 20 candidates generated
    libraries1_10[0].setMode(TagLibrary.USE_PER_GROUP);          
    proj.getSettings().getCandidateModulesStage1().add(dummy);   
      
    task = pm.getProbeDesignTask(false, true, true, new GoodAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new GreedyTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
    task.run();
   
    candCount = task.getCandidatesGenerated();   
    assertTrue("20 candidates expected, " + candCount + " generated.",candCount == 20);      //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    proj.getTargets().addSequence(t1);   
    proj.getTargets().addSequence(t2);   
    pm.setProject(proj);
   
    pm.getProbeDesignTask(false, true, true, new AllAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new PairwiseTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true)).run();

    Probe p1 = proj.getProbes().getSequenceAt(0);
    Probe p2 = proj.getProbes().getSequenceAt(1);

    assertEquals(ProbeMakerPropertyUtils.getRank(p1),ProbeMakerConstants.GOOD_QUALITY);
    assertEquals(ProbeMakerPropertyUtils.getRank(p2),ProbeMakerConstants.BAD_QUALITY);

    proj.getTagAllocationTable().clearUsed();
   
    //Two probes single tag unique, with dummy. Expect first ok, second bad
    proj.getSettings().getCandidateModulesStage2().add(dummy);
      
    ProbeDesignTask task = pm.getProbeDesignTask(false, true, true, new AllAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new PairwiseTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
    task.run();
   
    p1 = proj.getProbes().getSequenceAt(0);
    p2 = proj.getProbes().getSequenceAt(1);

    assertEquals(ProbeMakerPropertyUtils.getAllMessages(p1).size(),1);
    assertEquals(ProbeMakerPropertyUtils.getRank(p1),ProbeMakerConstants.OK_QUALITY);
    assertEquals(ProbeMakerPropertyUtils.getRank(p2),ProbeMakerConstants.BAD_QUALITY);
    assertEquals(task.getCandidatesGenerated(),1);
   
    proj.getTagAllocationTable().clearUsed();
   
    //Test single-tag use same
    libraries1_1[0].setMode(TagLibrary.USE_SAME_TAG);
    proj.setTagSettings(new DefaultTagSettings(libraries1_1));
    proj.getSettings().getCandidateModulesStage2().clear();
    pm.getProbeDesignTask(false, true, true, new AllAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new PairwiseTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true)).run();

    p1 = proj.getProbes().getSequenceAt(0);
    p2 = proj.getProbes().getSequenceAt(1);

    assertEquals(ProbeMakerPropertyUtils.getRank(p1),ProbeMakerConstants.GOOD_QUALITY);
    assertEquals(ProbeMakerPropertyUtils.getRank(p2),ProbeMakerConstants.GOOD_QUALITY);

//  Test single-tag use unique in group with one expanded
    //expect first probe to succeed but be set to bad when second one failed
    //Third probe then set to good
    proj.getTagAllocationTable().clearUsed();
    libraries1_1[0].setMode(TagLibrary.USE_UNIQUE_IN_GROUP);
    proj.setTagSettings(new DefaultTagSettings(libraries1_1));
    proj.getTargets().clear();
    proj.getTargets().addSequence(t1);
    TargetHandler.expandTargets(proj.getTargets());
    proj.getTargets().addSequence(t2);
   
    task = pm.getProbeDesignTask(false, true, true, new AllAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new PairwiseTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
    task.run();

    p1 = proj.getProbes().getSequenceAt(0);
    p2 = proj.getProbes().getSequenceAt(1);
    Probe p3 = proj.getProbes().getSequenceAt(2);

   
    assertEquals(ProbeMakerPropertyUtils.getRank(p1),ProbeMakerConstants.BAD_QUALITY);
    assertEquals(ProbeMakerPropertyUtils.getRank(p2),ProbeMakerConstants.BAD_QUALITY);
   
    assertEquals(ProbeMakerPropertyUtils.getRank(p3),ProbeMakerConstants.GOOD_QUALITY);
    assertEquals(task.getCandidatesGenerated(),2);
   
    libraries1_1[0].setMode(TagLibrary.USE_UNIQUE_TAG);
   
//  Test single-tag use same with one expanded
    libraries2_1_1[0].setMode(TagLibrary.USE_UNIQUE_TAG);
    libraries2_1_1[1].setMode(TagLibrary.USE_UNIQUE_IN_GROUP);
    proj.setTagSettings(new DefaultTagSettings(libraries2_1_1));

    proj.getTargets().clear();
    proj.getTargets().addSequence(t1);
    TargetHandler.expandTargets(proj.getTargets());
    proj.getTargets().addSequence(t2);
   
    task = pm.getProbeDesignTask(false, true, true, new AllAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new PairwiseTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
    task.run();

    p1 = proj.getProbes().getSequenceAt(0);
    p2 = proj.getProbes().getSequenceAt(1);
    p3 = proj.getProbes().getSequenceAt(2);
View Full Code Here

    proj.getSettings().addCandidateModuleStage1(dummy);
    pm.setProject(proj);
    TargetHandler.expandTargets(pm.getProject().getTargets());

    ProbeDesignTask task = pm.getProbeDesignTask(false, true, true, new AllAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new PairwiseTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));

    task.run();

    Probe p = proj.getProbes().getSequenceAt(0);
    Probe p2 = proj.getProbes().getSequenceAt(1);

    //Move dummy to arm stage
    proj.getSettings().getCandidateModulesStage1().clear();
    proj.getSettings().addCandidateModuleStage2(dummy);
    task = pm.getProbeDesignTask(false, true, true, new AllAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new PairwiseTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true));
    task.run();

    Probe p3 = proj.getProbes().getSequenceAt(0);
    Probe p4 = proj.getProbes().getSequenceAt(1);
View Full Code Here

  }

  protected Probe[] performModeTest(byte mode) {
    pm.getProject().getTagSettings().getTagLibraries()[0].setMode(mode);
    pm.getProbeDesignTask(false, true, true, new AllAcceptor(),
        new NoSelector(), new DefaultProbeDesigner(new GreedyTagAllocator()), new DefaultTSSConstructor(), new StreamErrorHandler(System.out,true)).run();
   
    Probe[] probes = pm.getProject().getProbes().getSequenceList().toArray(new Probe[5]);
    return probes;
  }
View Full Code Here

      if (platform.getUI().inputData((ParameterPlugIn) ta,CoreMessages.getString("ProbeMakerPlugIn.TITLE_TAGALLOC_SETTINGS"))) { //$NON-NLS-1$
        return;
      }
    }

    final ProbeDesigner designer = new DefaultProbeDesigner(ta);

    //TODO reimplement uselog
    final boolean useLog = true;
    final ProbeDesignTask designTask = getProbeDesignTask(append, resetTags.booleanValue(), useLog, acceptor, selector, designer, con, platform);
View Full Code Here

      if (platform.getUI().inputData((ParameterPlugIn) ta,CoreMessages.getString("ProbeMakerPlugIn.TITLE_TAGALLOC_SETTINGS"))) { //$NON-NLS-1$
        return;
      }
    }

    final ProbeDesigner designer = new DefaultProbeDesigner(ta);

    //TODO reimplement uselog
    final boolean useLog = true;
    final ProbeDesignTask designTask = getProbeDesignTask(append, resetTags.booleanValue(), useLog, acceptor, selector, designer, con, platform);
View Full Code Here

TOP

Related Classes of org.moltools.apps.probemaker.design.DefaultProbeDesigner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.