MATSIM
Link.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * *
4  * *********************************************************************** *
5  * *
6  * copyright : (C) 2010 by the members listed in the COPYING, *
7  * LICENSE and WARRANTY file. *
8  * email : info at matsim dot org *
9  * *
10  * *********************************************************************** *
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * See also COPYING, LICENSE and WARRANTY file *
17  * *
18  * *********************************************************************** */
19 
20 package org.matsim.api.core.v01.network;
21 
22 import java.util.Set;
23 
27 
34 public interface Link extends BasicLocation, Attributable, Identifiable<Link> {
35 
36 
49  public boolean setFromNode(Node node);
50 
63  public boolean setToNode(Node node);
64 
68  public Node getToNode();
69 
73  public Node getFromNode();
74 
75 
76  public double getLength();
77 
78  public double getNumberOfLanes();
79 
80  public double getNumberOfLanes(double time);
81 
82  public double getFreespeed();
83 
84  public double getFreespeed(final double time);
85 
94  public double getCapacity();
95 
105  public double getCapacity(double time);
106 
107  public void setFreespeed(double freespeed);
108 
109  public void setLength(double length);
110 
111  public void setNumberOfLanes(double lanes);
112 
113  public void setCapacity(double capacity);
114 
115  public void setAllowedModes(Set<String> modes);
116 
120  public Set<String> getAllowedModes();
121 
122  double getCapacityPeriod();
123 
124  default double getFlowCapacityPerSec() {
125  return getCapacity() / getCapacityPeriod();
126  }
127 
128  default double getFlowCapacityPerSec(double time) {
129  return getCapacity(time) / getCapacityPeriod();
130  }
131 }