Class TractorWalk

java.lang.Object
casa.lepton.walk.GraphWalk
casa.lepton.walk.TractorWalk
All Implemented Interfaces:
Walk

public class TractorWalk extends GraphWalk
Graphe modélisant le parcours d'un tracteur Le parcours d'un tracteur est composé de 3 types de noeud : - le hangar : (unique) noeud étiqueté par le label "warehouse" avec la valeur true - l'entrée des champs : noeud étiqueté par le label "field_entry" avec la valeur true - les sillons dans le champs : ils forment un anneau connecté à la route par une entrée de champ - les routes : relient le hangar aux entrées de champs. L'ensemble des noeuds forme un GraphWalk
  • Constructor Details

    • TractorWalk

      public TractorWalk(casa.util.geom.AreaCar area, long minWait, long maxWait, double minSpeed, double maxSpeed, org.graphstream.graph.Graph graph, String pauseType, Random random)
      Parameters:
      area -
      minWait -
      maxWait -
      minSpeed -
      maxSpeed -
      graph -
      pauseType -
      random -
  • Method Details

    • getWalker

      public TractorWalker getWalker(long time, String nodeId)
      Description copied from interface: Walk
      Returns a new Walker that will move according to the mobility model implemented in this instance of Walk.
      Specified by:
      getWalker in interface Walk
      Overrides:
      getWalker in class GraphWalk
      Parameters:
      time - the time of creation of this walker
      Returns:
      a new Walker, whose mobility starts at the specified time
    • getDefault

      public static TractorWalk getDefault(OppNodeProperties props)
      Creates and returns an instance of TractorWalk, using system properties (if defined) in order to initialize this object, and using default values otherwise.
      Returns:
      a TractorWalk object, initialized using either system properties or default values
    • getRandomField

      public org.graphstream.graph.Node getRandomField(org.graphstream.graph.Node current_field)
      Choisit un noeud au hasard qui soit une entrée de champ différente d'une entrée donnée
      Parameters:
      current_field - un noeud entrée de champ ou null
      Returns:
      un autre noeud entrée de champ ou null s'il n'en existe pas de différent de celui donné
    • getWarehouse

      public org.graphstream.graph.Node getWarehouse()
      Accesseur du noeud hangar
      Returns:
      le noeud hangar
    • getRowPath

      public List<org.graphstream.graph.Node> getRowPath(String tractor_id, org.graphstream.graph.Node road_node, org.graphstream.graph.Node field_node)
      Construction d'un chemin permettant de parcourir la totalité d'un champ et de revenir au point de départ en suivant des rangs
      Parameters:
      tractor_id - identifiant du tracteur
      road_node - noeud sur la route, précédant l'entrée du champ
      field_node - noeud de l'entrée du champ
      Returns:
      le chemin parcourant tous les rangs du champ et se terminant par l'entrée du champ ou null si aucun chemin n'a été trouvé