Codota Logo
ActivityFacilitiesImpl.createAndAddFacility
Code IndexAdd Codota to your IDE (free)

How to use
createAndAddFacility
method
in
org.matsim.facilities.ActivityFacilitiesImpl

Best Java code snippets using org.matsim.facilities.ActivityFacilitiesImpl.createAndAddFacility (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: matsim-org/matsim

public final ActivityFacilityImpl createAndAddFacility(final Id<ActivityFacility> id, final Coord center) {
  return createAndAddFacility(id, center, null);
}

origin: matsim-org/matsim

public static ActivityFacilities createHexagonLayer(double minX, double minY, double maxX, double maxY, int maxDiameter_m) {
  LOG.info("Start creating measure points on a hexagon pattern.");
  double inRadius_m = Math.sqrt(3) / 4 * maxDiameter_m;
  int skippedPoints = 0;
  int setPoints = 0;
  ActivityFacilitiesImpl measuringPoints = (ActivityFacilitiesImpl) FacilitiesUtils.createActivityFacilities("accessibility measuring points");
  int columnNumber = 1;
  for (double x = minX; x < (maxX - 1./2 * maxDiameter_m); x += (3./4 * maxDiameter_m)) {
    for (double y = minY; y <= maxY; y += (2 * inRadius_m)) {
      double centerX = x;
      double centerY;
      if (columnNumber % 2 != 0) {
        centerY = y;
      } else {
        centerY = y + inRadius_m;
      }
      if (centerX <= maxX && centerX >= minX && centerY <= maxY && centerY >= minY) {
        Coord center = new Coord(centerX, centerY);
        measuringPoints.createAndAddFacility(Id.create(setPoints, ActivityFacility.class), center);
        setPoints++;
      }
      else skippedPoints++; 
    }
    columnNumber++;
  }
  LOG.info("Created " + setPoints + " inside the boundary. " + skippedPoints + " lie outside.");
  LOG.info("Finished creating measure points on a hexagon pattern.");
  return measuringPoints;
}
origin: matsim-org/matsim

measuringPoints.createAndAddFacility(Id.create(setPoints, ActivityFacility.class), center);
setPoints++;
origin: matsim-org/matsim

measuringPoints.createAndAddFacility(Id.create( setPoints , ActivityFacility.class), center);
setPoints++;
origin: matsim-org/matsim

public void testRunAlgorithms() {
  final ActivityFacilitiesImpl facilities = new ActivityFacilitiesImpl();
  // create 2 facilities
  facilities.createAndAddFacility(Id.create(1, ActivityFacility.class), new Coord(1.0, 1.0));
  facilities.createAndAddFacility(Id.create(2, ActivityFacility.class), new Coord(2.0, 2.0));
  // create an algo and let it run over the facilities
  MockAlgo1 algo1 = new MockAlgo1();
  algo1.run(facilities);
  assertEquals("TestAlgo should have handled 2 facilities.", 2, algo1.getCounter());
}
org.matsim.facilitiesActivityFacilitiesImplcreateAndAddFacility

Popular methods of ActivityFacilitiesImpl

  • <init>
  • getFacilities
  • buildQuadTree

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • startActivity (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now