MATSIM
Packages | Classes
Package org.matsim.utils.objectattributes

Packages

package  attributable
 
package  attributeconverters
 

Classes

interface  AttributeConverter
 
class  FailingObjectAttributes
 
class  ObjectAttributes
 
class  ObjectAttributesConverter
 
class  ObjectAttributesUtils
 
class  ObjectAttributesXmlReader
 
class  ObjectAttributesXmlWriter
 
class  RunObjectAttributesExample
 
class  StringDoubleMap
 

Detailed Description

Supports keeping track of arbitrary attributes for identifiable objects.

An example usage can be seen in org.matsim.utils.objectattributes.RunObjectAttributesExample.

Design thoughts

I think of ObjectAttributes (OA) as a way to provide specific additional data to algorithms and modules. Typically, specialized algorithms/modules might require additional data than what is available by default in MATSim's data container (like population, network). For example, modules could need information about persons' income, a node's z-coordinate, or a link's curviness.

Important to consider is that the algorithm always has to specify what additional data it needs so it can access it. In the example above, an algorithm that needs a person's income needs to know the name of the attribute containing the income. Typically, it could do so by providing a setter setPersonIncomeAttributeName(String) or even exposing it as a config-parameter.

This implies that modules should always just access a few specific attributes, but they should never have the need to just access all attributes and then maybe figure out what they could do with the available attributes, probably even guessing some interpretation of the attributes based on their names. <strike>For this reason, there is no method available directly in org.matsim.utils.objectattributes.ObjectAttributes that returns all attributes for a specific object. Only getters for single, named attributes are providers. </strike>