Class TravellerType

  • All Implemented Interfaces:
    Comparable<IdAble>, ExternalIdAble, IdAble, ManagedId

    public class TravellerType
    extends ExternalIdAbleImpl
    implements ManagedId
    Traveller type is a placeholder for all different types of traveler characteristics that affect the user class in the path choice component of traffic assignment. Together with the mode this largely defines each user class TODO: Not used yet in UserClass class
    Author:
    markr
    • Constructor Detail

      • TravellerType

        public TravellerType​(IdGroupingToken groupId)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
      • TravellerType

        public TravellerType​(TravellerType other)
        Copy constructor
        Parameters:
        other - to copy
      • TravellerType

        public TravellerType​(IdGroupingToken groupId,
                             String name)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        name - name of this traveler type
    • Method Detail

      • generateId

        protected static long generateId​(IdGroupingToken tokenId)
        Generate id for instances of this class based on the token and class identifier
        Parameters:
        tokenId - to use
        Returns:
        generated id
      • recreateManagedIds

        public long recreateManagedIds​(IdGroupingToken tokenId)
        recreate the internal id(s) and set them including the Idable id
        Specified by:
        recreateManagedIds in interface ManagedId
        Parameters:
        tokenId - to use (may be null in case managed id entity does not rely on token to recreate its managed id(s))
        Returns:
        the updated internal id
      • getIdClass

        public Class<? extends TravellerType> getIdClass()
        Each managed id class is expected to generate its ids based on its class signature. To be able to generate the correct id the class used for id generation is to be provided via this method call.
        Specified by:
        getIdClass in interface ManagedId
        Returns:
        idClass to use for generating ids for instances of this idable derived class
      • hasName

        public boolean hasName()
        check if it has a name
        Returns:
        true when name is present false otherwise
      • getName

        public String getName()
        Collect the name
        Returns:
        name
      • deepClone

        public TravellerType deepClone()
        An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code
        Specified by:
        deepClone in interface IdAble
        Overrides:
        deepClone in class ExternalIdAbleImpl
        Returns:
        deep copy of entity