Examples of Instance


Examples of com.github.pmerienne.trident.ml.core.Instance

      double[] features = new double[args.length];
      for (int i = 0; i < args.length; i++) {
        features[i] = Double.parseDouble(args[i]);
      }

      Instance<?> instance = new Instance(features);
      collector.emit(new Values(instance));
    }
View Full Code Here

Examples of com.google.api.services.compute.model.Instance

    refreshState();
  }

  public void refreshState() throws OpsException {
    Instance newState = computeClient.findInstanceByName(instance.getName());

    if (newState == null) {
      // Not found => deleted
      terminated = true;
    } else {
View Full Code Here

Examples of com.google.errorprone.BugPattern.Instance

public class BugPatternIndexYamlWriterTest {
  @Test
  public void dump() throws Exception {
    StringWriter writer = new StringWriter();

    Instance pattern1 = new Instance();
    pattern1.severity = SeverityLevel.ERROR;
    pattern1.maturity = MaturityLevel.EXPERIMENTAL;
    pattern1.name = "BugPatternA";
    pattern1.summary = "Here's the \"interesting\" summary";

    Instance pattern2 = new Instance();
    pattern2.severity = SeverityLevel.ERROR;
    pattern2.maturity = MaturityLevel.EXPERIMENTAL;
    pattern2.name = "BugPatternB";
    pattern2.summary = "{summary2}";

    Instance pattern3 = new Instance();
    pattern3.severity = SeverityLevel.ERROR;
    pattern3.maturity = MaturityLevel.MATURE;
    pattern3.name = "BugPatternC";
    pattern3.summary = "mature";
View Full Code Here

Examples of com.jgaap.util.Instance

    /*
     * Put together the training set
     */
    for (int i = 0; i < knownEventMaps.size(); i++) {
      EventMap knownEventMap = knownEventMaps.get(i);
      Instance currentTrainingDocument = new Instance(
          allEvents.size() + 1);
      currentTrainingDocument.setValue((Attribute) attributeList
          .elementAt(0), knownDocuments.get(i).getAuthor());
      int j = 1; // Start counting events (at 1, since 0 is the author
            // label)
      for (Event event : allEvents) {
        currentTrainingDocument.setValue(
            (Attribute) attributeList.elementAt(j),
            knownEventMap.normalizedFrequency(event));
        j++;
      }
      trainingSet.add(new SparseInstance(currentTrainingDocument));
View Full Code Here

Examples of com.netflix.astyanax.connectionpool.LatencyScoreStrategy.Instance

       
        final AtomicBoolean timeoutsEnabled = new AtomicBoolean(false);
        final AtomicLong lastOperationCount = new AtomicLong();
       
        EmaLatencyScoreStrategyImpl latency = new EmaLatencyScoreStrategyImpl(1000, 0, 10);
        final Instance sampler = latency.createInstance();
        latency.start(new Listener() {
            @Override
            public void onUpdate() {
            }
            @Override
            public void onReset() {
            }
        });
        final Function<TestDriver, Void> function = new ProbabalisticFunction.Builder<TestDriver, Void>()
            .withDefault(new Function<TestDriver, Void>() {
                public Void apply(TestDriver arg0) {
                    return null;
                }
            })
            .withAlways(new Runnable() {
                public void run() {
                    think(10, 30);
                }
            })
//            .withProbability(0.0001, new Function<TestDriver, Void>() {
//                public Void apply(@Nullable TestDriver arg0) {
//                    if (timeoutsEnabled.get()) {
//                        think(1100, 0);
//                        throw new RuntimeException(new TimeoutException("TimeoutException"));
//                    }
//                    return null;
//                }
//            })
//            .withProbability(0.0001, new Function<TestDriver, Void>() {
//                public Void apply(@Nullable TestDriver arg0) {
//                    throw new RuntimeException(new UnknownException(new Exception("UnknownExceptionDescription")));
//                }
//            })
//            .withProbability(0.0001, new Function<TestDriver, Void>() {
//                public Void apply(@Nullable TestDriver arg0) {
//                    think(1000, 0);
//                    throw new RuntimeException(new OperationTimeoutException("OperationTimeoutException"));
//                }
//            })
//            .withProbability(0.0001, new Function<TestDriver, Void>() {
//                public Void apply(@Nullable TestDriver arg0) {
//                    throw new RuntimeException(new HostDownException("HostDownException"));
//                }
//            })
//            .withProbability(0.01, new Function<TestDriver, Void>() {
//                public Void apply(@Nullable TestDriver arg0) {
//                    throw new RuntimeException(new ConnectionAbortedException("ConnectionAbortedException"));
//                }
//            })
//            .withProbability(0.0001, new Function<TestDriver, Void>() {
//                public Void apply(@Nullable TestDriver arg0) {
//                    throw new RuntimeException(new BadRequestException("BadRequestException"));
//                }
//            })
//            .withProbability(0.0001, new Function<TestDriver, Void>() {
//                public Void apply(@Nullable TestDriver arg0) {
//                    throw new RuntimeException(new TokenRangeOfflineException("TokenRangeOfflineException"));
//                }
//            })
//            .withProbability(0.0001, new Function<TestDriver, Void>() {
//                public Void apply(@Nullable TestDriver arg0) {
//                    throw new RuntimeException(new TransportException("TransportException"));
//                }
//            })
        .build();
       
        final List<HostConnectionPool<TestClient>> hostPools = Lists.newArrayList(pool.getActivePools());
       
        final TestDriver driver = new TestDriver.Builder()
            .withIterationCount(0)
            .withThreadCount(200)
//            .withFutures(100,  TimeUnit.MILLISECONDS)
            .withCallsPerSecondSupplier(Suppliers.ofInstance(200))
//            .withFutures(100, TimeUnit.MILLISECONDS)
            .withCallback(new Function<TestDriver, Void>() {
                public Void apply(final TestDriver driver) {
                    long startTime = System.nanoTime();
                    try {
                        pool.executeWithFailover(new TestOperation() {
                            public String execute(TestClient client) throws ConnectionException, OperationException {
                                try {
                                    function.apply(driver);
                                    return null;
                                }
                                catch (RuntimeException e) {
                                    if (e.getCause() instanceof ConnectionException)
                                        throw (ConnectionException)e.getCause();
                                    throw e;
                                }
                            }
                        }, new RunOnce());
                    } catch (PoolTimeoutException e) {
                        LOG.info(e.getMessage());
                    } catch (ConnectionException e) {
                    } finally {
                        sampler.addSample((System.nanoTime() - startTime)/1000000);
                    }
                   
                    return null;
                }
            })
           
            //
            //  Event to turn timeouts on/off
            //
            .withRecurringEvent(10,  TimeUnit.SECONDS,  new Function<TestDriver, Void>() {
                @Override
                public Void apply(TestDriver driver) {
                    timeoutsEnabled.getAndSet(!timeoutsEnabled.get());
//                    LOG.info("Toggle timeouts " + timeoutsEnabled.get());
                    return null;
                }
            })
           
            //
            //  Print status information
            //
            .withRecurringEvent(1,  TimeUnit.SECONDS,  new Function<TestDriver, Void>() {
                @Override
                public Void apply(TestDriver driver) {
                    long opCount = lastOperationCount.get();
                    lastOperationCount.set(driver.getOperationCount());
                   
                    System.out.println("" + driver.getRuntime() + "," + sampler.getScore() + "," + (lastOperationCount.get() - opCount));
                    System.out.println(monitor.toString());
                    System.out.println(monitor.toString());
                    for (HostConnectionPool<TestClient> host : pool.getPools()) {
                        System.out.println("   " + host.toString());
                    }
View Full Code Here

Examples of com.skcraft.launcher.Instance

        instancesTable.addMouseListener(new PopupMouseAdapter() {
            @Override
            protected void showPopup(MouseEvent e) {
                int index = instancesTable.rowAtPoint(e.getPoint());
                Instance selected = null;
                if (index >= 0) {
                    instancesTable.setRowSelectionInterval(index, index);
                    selected = launcher.getInstances().get(index);
                }
                popupInstanceMenu(e.getComponent(), e.getX(), e.getY(), selected);
View Full Code Here

Examples of edu.byu.ece.rapidSmith.design.Instance

            parts = newParts;
          }
          currElement.setType(parts[2]);
          //System.out.println("line="+line+", parts=" + parts.length);
          if(design != null){
            Instance instance = design.getInstance(parts[4]);
            ((LogicPathElement)currElement).setInstance(instance);
            if(instance == null){
              MessageGenerator.briefErrorAndExit("This instance \"" + parts[4] +
              "\" is null.");
            }
            Pin p = instance.getPin(pinName);
            if(p == null){
              //System.out.println("Problem Getting Pin: " + parts[1]);
              //System.out.println("Line: " + line);
              //System.exit(1);
            }
View Full Code Here

Examples of edu.stanford.smi.protege.model.Instance

    }

    public void addRdfsLabel(RDFSNamedClass cls) {
        try {
            String code = (String) cls.getPropertyValue(getIcdCodeProperty());
            Instance titleInst = (Instance) cls.getPropertyValue(getIcdTitleProperty());
            String title = (String) titleInst.getOwnSlotValue(getLabelProperty());
            cls.addLabel(code + ". " + title, null);
        } catch (Exception e) {
            log.log(Level.WARNING, "Could not set rdfs:label for " + cls);
        }
    }
View Full Code Here

Examples of fr.imag.adele.apam.Instance

    /*
     * If the target of the wire is a non sharable instance, the released
     * instance can potentially be used by a pending requests.
     */
    if (link.getDestination() instanceof Instance) {
      Instance candidate = (Instance) link.getDestination();

      if ((!candidate.isShared()) && candidate.isSharable()) {
        resolveDynamicRequests(candidate);
      }
    }
  }
View Full Code Here

Examples of io.fathom.cloud.compute.api.aws.ec2.model.Instance

        }
        return s;
    }

    protected Instance buildRunningInstanceXml(ReservationData reservationInfo, InstanceData instanceInfo) {
        Instance instance = new Instance();
        instance.instanceId = toEc2InstanceId(instanceInfo.getId());
        instance.imageId = toEc2ImageId(reservationInfo.getImageId());

        instance.instanceState = buildInstanceState(instanceInfo);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.