public class OtpsPopulation extends Object implements Iterable<OtpsIndividual>
spt = ...
pop = otp.loadCSVPopulation('pop.csv', 'lat', 'lon')
result = spt.eval(pop)
for r in result:
print r.getTime()
| Modifier | Constructor and Description |
|---|---|
protected |
OtpsPopulation() |
protected |
OtpsPopulation(Population population) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIndividual(double lat,
double lon)
Add a new data-less individual to the collection.
|
void |
addIndividual(double lat,
double lon,
String[] data)
Add a new individual with some data attached to it.
|
protected int |
getDataIndex(String dataName) |
Iterator<OtpsIndividual> |
iterator() |
protected static OtpsPopulation |
loadFromCSV(String filename,
String latColName,
String lonColName) |
void |
setHeaders(String[] headers)
Set data header keys.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprotected OtpsPopulation()
protected OtpsPopulation(Population population)
public void setHeaders(String[] headers)
headers - The data header, in order. Later used as a key to retrieve individual data
value.protected int getDataIndex(String dataName)
public void addIndividual(double lat,
double lon)
lat - Latitude of the individual locationlon - Longitude of the individual locationpublic void addIndividual(double lat,
double lon,
String[] data)
lat - Latitude of the individual locationlon - Longitude of the individual locationdata - An array of data to store in the individualpublic Iterator<OtpsIndividual> iterator()
iterator in interface Iterable<OtpsIndividual>protected static OtpsPopulation loadFromCSV(String filename, String latColName, String lonColName) throws IOException
IOExceptionCopyright © 2018. All rights reserved.