1 package org.opentrafficsim.core.network; 2 3 import java.util.List; 4 import java.util.Set; 5 6 import org.djutils.immutablecollections.ImmutableMap; 7 import org.opentrafficsim.base.Identifiable; 8 import org.opentrafficsim.core.definitions.Definitions; 9 import org.opentrafficsim.core.gtu.GTUType; 10 import org.opentrafficsim.core.network.route.CompleteRoute; 11 import org.opentrafficsim.core.network.route.Route; 12 import org.opentrafficsim.core.object.InvisibleObjectInterface; 13 import org.opentrafficsim.core.object.ObjectInterface; 14 15 import nl.tudelft.simulation.event.EventProducerInterface; 16 import nl.tudelft.simulation.event.EventType; 17 18 /** 19 * Interface that defines what information a network should be able to provide about Nodes, Links and Routes. 20 * <p> 21 * Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br> 22 * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>. 23 * <p> 24 * $LastChangedDate: 2019-03-17 22:16:44 +0100 (Sun, 17 Mar 2019) $, @version $Revision: 5158 $, by $Author: averbraeck $, 25 * initial version Jul 22, 2015 <br> 26 * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a> 27 * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a> 28 * @author <a href="http://www.citg.tudelft.nl">Guus Tamminga</a> 29 */ 30 public interface Network extends Definitions, EventProducerInterface, Identifiable 31 { 32 /** @return String; the id */ 33 @Override 34 String getId(); 35 36 /***************************************************************************************/ 37 /**************************************** NODES ****************************************/ 38 /***************************************************************************************/ 39 40 /** 41 * Provide an immutable map of node ids to nodes in the network. 42 * @return an immutable map of nodes. 43 */ 44 ImmutableMap<String, Node> getNodeMap(); 45 46 /** 47 * Register a node in the network. 48 * @param node Node; the node to add to the network. 49 * @throws NetworkException if node already exists in the network, or if name of the node is not unique. 50 */ 51 void addNode(Node node) throws NetworkException; 52 53 /** 54 * Unregister a node from the network. 55 * @param node Node; the node to remove from the network. 56 * @throws NetworkException if node does not exist in the network. 57 */ 58 void removeNode(Node node) throws NetworkException; 59 60 /** 61 * Test whether a node is present in the network. 62 * @param node Node; the node to search for in the network. 63 * @return whether the node is in this network 64 */ 65 boolean containsNode(Node node); 66 67 /** 68 * Test whether a node with a given id is present in the network. 69 * @param nodeId String; the id of the node to search for in the network. 70 * @return whether the node is in this network 71 */ 72 boolean containsNode(String nodeId); 73 74 /** 75 * Retrieve a node with a given id from the network, or null if the id cannot be found. 76 * @param nodeId String; the id of the node to search for in the network. 77 * @return the node or null if not present 78 */ 79 Node getNode(String nodeId); 80 81 /***************************************************************************************/ 82 /**************************************** LINKS ****************************************/ 83 /***************************************************************************************/ 84 85 /** 86 * Provide an immutable map of link ids to links in the network. 87 * @return the an immutable map of links. 88 */ 89 ImmutableMap<String, Link> getLinkMap(); 90 91 /** 92 * Register a link in the network. 93 * @param link Link; the link to add to the network. 94 * @throws NetworkException if link already exists in the network, if name of the link is not unique, or if the start node 95 * or the end node of the link are not registered in the network. 96 */ 97 void addLink(Link link) throws NetworkException; 98 99 /** 100 * Unregister a link from the network. 101 * @param link Link; the link to remove from the network. 102 * @throws NetworkException if link does not exist in the network. 103 */ 104 void removeLink(Link link) throws NetworkException; 105 106 /** 107 * Test whether a link is present in the network. 108 * @param link Link; the link to search for in the network. 109 * @return whether the link is in this network 110 */ 111 boolean containsLink(Link link); 112 113 /** 114 * Test whether a link with a given id is present in the network. 115 * @param link String; the id of the link to search for in the network. 116 * @return whether the link is in this network 117 */ 118 boolean containsLink(String link); 119 120 /** 121 * Retrieve a node with a given id from the network, or null if the id cannot be found. 122 * @param linkId String; the id of the link to search for in the network. 123 * @return the link or null if not present 124 */ 125 Link getLink(String linkId); 126 127 /** 128 * Find a link between node1 and node2 and return it if it exists in the network. If not, return null. 129 * @param node1 Node; first node 130 * @param node2 Node; second node 131 * @return the link between node1 and node2 in the network or null if it does not exist. 132 */ 133 Link getLink(Node node1, Node node2); 134 135 /** 136 * Find a link between node1 and node2 and return it if it exists in the network. If not, return null. 137 * @param nodeId1 String; id of the first node 138 * @param nodeId2 String; id of the second node 139 * @return the link between node1 and node2 in the network or null if it does not exist. 140 * @throws NetworkException if the node(s) cannot be found by their id 141 */ 142 Link getLink(String nodeId1, String nodeId2) throws NetworkException; 143 144 /***************************************************************************************/ 145 /************************ OBJECT INTERFACE IMPLEMENTING OBJECTS ************************/ 146 /***************************************************************************************/ 147 148 /** 149 * Return an immutable map of all ObjectInterface implementing objects in the Network. 150 * @return ImmutableMap<String, ObjectInterface>; the immutable map of all ObjectInterface implementing objects in the 151 * Network 152 */ 153 ImmutableMap<String, ObjectInterface> getObjectMap(); 154 155 /** 156 * Return an immutable map of all ObjectInterface implementing objects in the network that are of type objectType, or any 157 * sub type thereof. 158 * @param objectType Class<T>; the (sub-)type of ObjectInterface that the returned map is reduced to 159 * @param <T> type of object 160 * @return ImmutableMap<String, ObjectInterface>; the immutable map of all ObjectInterface implementing objects in the 161 * Network that are of the type objectType, or any sub type thereof 162 */ 163 <T extends ObjectInterface> ImmutableMap<String, T> getObjectMap(Class<T> objectType); 164 165 /** 166 * Return object of given type with given id. 167 * @param objectType T; object type class 168 * @param objectId String; id of object 169 * @param <T> object type 170 * @return T; object of given type with given id, {@code null} if no such object 171 */ 172 <T extends ObjectInterface> T getObject(Class<T> objectType, String objectId); 173 174 /** 175 * Add an ObjectInterface implementing object to the Network. 176 * @param object ObjectInterface; the object that implements ObjectInterface 177 * @throws NetworkException if link already exists in the network, if name of the object is not unique. 178 */ 179 void addObject(ObjectInterface object) throws NetworkException; 180 181 /** 182 * Remove an ObjectInterface implementing object form the Network. 183 * @param object ObjectInterface; the object that implements ObjectInterface 184 * @throws NetworkException if the object does not exist in the network. 185 */ 186 void removeObject(ObjectInterface object) throws NetworkException; 187 188 /** 189 * Test whether the object is present in the Network. 190 * @param object ObjectInterface; the object that is tested for presence 191 * @return boolean; whether the object is present in the Network 192 */ 193 boolean containsObject(ObjectInterface object); 194 195 /** 196 * Test whether an object with the given id is present in the Network. 197 * @param objectId String; the id that is tested for presence 198 * @return boolean; whether an object with the given id is present in the Network 199 */ 200 boolean containsObject(String objectId); 201 202 /***************************************************************************************/ 203 /********************************* INVISIBLE OBJECTS ***********************************/ 204 /***************************************************************************************/ 205 206 /** 207 * Return an immutable map of all InvisibleObject implementing objects in the Network. 208 * @return ImmutableMap<String, ObjectInterface>; the immutable map of all ObjectInterface implementing objects in the 209 * Network 210 */ 211 ImmutableMap<String, InvisibleObjectInterface> getInvisibleObjectMap(); 212 213 /** 214 * Return an immutable map of all InvisibleObject implementing objects in the network that are of type objectType, or any 215 * sub type thereof. 216 * @param objectType Class<InvisibleObjectInterface>; the (sub-)type of InvisibleObject that the returned map is 217 * reduced to 218 * @return ImmutableMap<String, InvisibleObject>; the immutable map of all InvisibleObject implementing objects in the 219 * Network that are of the type objectType, or any sub type thereof 220 */ 221 ImmutableMap<String, InvisibleObjectInterface> getInvisibleObjectMap(Class<InvisibleObjectInterface> objectType); 222 223 /** 224 * Add an ObjectInterface implementing object to the Network. 225 * @param object InvisibleObjectInterface; the object that implements ObjectInterface 226 * @throws NetworkException if link already exists in the network, if name of the object is not unique. 227 */ 228 void addInvisibleObject(InvisibleObjectInterface object) throws NetworkException; 229 230 /** 231 * Remove an ObjectInterface implementing object form the Network. 232 * @param object InvisibleObjectInterface; the object that implements ObjectInterface 233 * @throws NetworkException if the object does not exist in the network. 234 */ 235 void removeInvisibleObject(InvisibleObjectInterface object) throws NetworkException; 236 237 /** 238 * Test whether the invisible object is present in the Network. 239 * @param object InvisibleObjectInterface; the object that is tested for presence 240 * @return boolean; whether the invisible object is present in the Network 241 */ 242 boolean containsInvisibleObject(InvisibleObjectInterface object); 243 244 /** 245 * Test whether an invisible object with the given id is present in the Network. 246 * @param objectId String; the id that is tested for presence 247 * @return boolean; whether an invisible object with the given id is present in the Network 248 */ 249 boolean containsInvisibleObject(String objectId); 250 251 /***************************************************************************************/ 252 /*************************************** ROUTES ****************************************/ 253 /***************************************************************************************/ 254 255 /** 256 * Return an immutable map of routes that exist in the network for the GTUType. 257 * @param gtuType GTUType; the GTUType for which to retrieve the defined routes 258 * @return an immutable map of routes in the network for the given GTUType, or an empty Map if no routes are defined for the 259 * given GTUType. 260 */ 261 ImmutableMap<String, Route> getDefinedRouteMap(GTUType gtuType); 262 263 /** 264 * Add a route to the network. 265 * @param gtuType GTUType; the GTUType for which to add a route 266 * @param route Route; the route to add to the network. 267 * @throws NetworkException if route already exists in the network, if name of the route is not unique, if one of the nodes 268 * of the route are not registered in the network. 269 */ 270 void addRoute(GTUType gtuType, Route route) throws NetworkException; 271 272 /** 273 * Remove the route from the network, e.g. because of road maintenance. 274 * @param gtuType GTUType; the GTUType for which to remove a route 275 * @param route Route; the route to remove from the network. 276 * @throws NetworkException if route does not exist in the network. 277 */ 278 void removeRoute(GTUType gtuType, Route route) throws NetworkException; 279 280 /** 281 * Return the route with the given id in the network for the given GTUType, or null if it the route with the id does not 282 * exist. 283 * @param gtuType GTUType; the GTUType for which to retrieve a route based on its id. 284 * @param routeId String; the route to search for in the network. 285 * @return the route or null if not present 286 */ 287 Route getRoute(GTUType gtuType, String routeId); 288 289 /** 290 * Determine whether the provided route exists in the network for the given GTUType. 291 * @param gtuType GTUType; the GTUType for which to check whether the route exists 292 * @param route Route; the route to check for 293 * @return whether the route exists in the network for the given GTUType 294 */ 295 boolean containsRoute(GTUType gtuType, Route route); 296 297 /** 298 * Determine whether a route with the given id exists in the network for the given GTUType. 299 * @param gtuType GTUType; the GTUType for which to check whether the route exists 300 * @param routeId String; the id of the route to check for 301 * @return whether a route with the given id exists in the network for the given GTUType 302 */ 303 boolean containsRoute(GTUType gtuType, String routeId); 304 305 /** 306 * Return the the shortest route between two nodes in the network, via a list of intermediate nodes. If no path exists from 307 * the start node to the end node via the intermediate nodes in the network, null is returned. 308 * @param gtuType GTUType; the GTUType for which to retrieve the defined routes 309 * @param nodeFrom Node; the start node. 310 * @param nodeTo Node; the end node. 311 * @return a set with routes from the start Node to the end Node in the network; if no route can be found, an empty set is 312 * returned. 313 */ 314 Set<Route> getRoutesBetween(GTUType gtuType, Node nodeFrom, Node nodeTo); 315 316 /** 317 * (Re)build the underlying graph for the given GTUType. 318 * @param gtuType GTUType; the GTUType for which to (re)build the graph 319 */ 320 void buildGraph(GTUType gtuType); 321 322 /** 323 * Calculate the shortest route between two nodes in the network. If no path exists from the start node to the end node in 324 * the network, null is returned. This method returns a CompleteRoute, which includes all nodes to get from start to end. In 325 * case the graph for the GTUType has not yet been built, this method will call the buildGraph method. 326 * @param gtuType GTUType; the GTUType for which to calculate the shortest route 327 * @param nodeFrom Node; the start node. 328 * @param nodeTo Node; the end node. 329 * @return the shortest route from the start Node to the end Node in the network. If no path exists from the start node to 330 * the end node in the network, null is returned. 331 * @throws NetworkException in case nodes cannot be added to the route, e.g. because they are not directly connected. This 332 * can be the case when the links in the network have changed, but the graph has not been rebuilt. 333 */ 334 default CompleteRoute getShortestRouteBetween(GTUType gtuType, Node nodeFrom, Node nodeTo) throws NetworkException 335 { 336 return getShortestRouteBetween(gtuType, nodeFrom, nodeTo, LinkWeight.LENGTH); 337 } 338 339 /** 340 * Calculate the shortest route between two nodes in the network. If no path exists from the start node to the end node in 341 * the network, null is returned. This method returns a CompleteRoute, which includes all nodes to get from start to end. 342 * This method recalculates the graph. 343 * @param gtuType GTUType; the GTUType for which to calculate the shortest route 344 * @param nodeFrom Node; the start node. 345 * @param nodeTo Node; the end node. 346 * @param linkWeight LinkWeight; link weight. 347 * @return the shortest route from the start Node to the end Node in the network. If no path exists from the start node to 348 * the end node in the network, null is returned. 349 * @throws NetworkException in case nodes cannot be added to the route, e.g. because they are not directly connected. This 350 * can be the case when the links in the network have changed, but the graph has not been rebuilt. 351 */ 352 CompleteRoute getShortestRouteBetween(GTUType gtuType, Node nodeFrom, Node nodeTo, LinkWeight linkWeight) 353 throws NetworkException; 354 355 /** 356 * Calculate the shortest route between two nodes in the network, via a list of intermediate nodes. If no path exists from 357 * the start node to the end node via the intermediate nodes in the network, null is returned. This method returns a 358 * CompleteRoute, which includes all nodes to get from start to end. In case the graph for the GTUType has not yet been 359 * built, this method will call the buildGraph method. 360 * @param gtuType GTUType; the GTUType for which to calculate the shortest route 361 * @param nodeFrom Node; the start node. 362 * @param nodeTo Node; the end node. 363 * @param nodesVia List<Node>; a number of nodes that the GTU has to pass between nodeFrom and nodeTo in the given 364 * order. 365 * @return the shortest route between two nodes in the network, via the intermediate nodes. If no path exists from the start 366 * node to the end node via the intermediate nodes in the network, null is returned. 367 * @throws NetworkException in case nodes cannot be added to the route, e.g. because they are not directly connected. This 368 * can be the case when the links in the network have changed, but the graph has not been rebuilt. 369 */ 370 default CompleteRoute getShortestRouteBetween(GTUType gtuType, Node nodeFrom, Node nodeTo, List<Node> nodesVia) 371 throws NetworkException 372 { 373 return getShortestRouteBetween(gtuType, nodeFrom, nodeTo, nodesVia, LinkWeight.LENGTH); 374 } 375 376 /** 377 * Calculate the shortest route between two nodes in the network, via a list of intermediate nodes. If no path exists from 378 * the start node to the end node via the intermediate nodes in the network, null is returned. This method returns a 379 * CompleteRoute, which includes all nodes to get from start to end. This method recalculates the graph. 380 * @param gtuType GTUType; the GTUType for which to calculate the shortest route 381 * @param nodeFrom Node; the start node. 382 * @param nodeTo Node; the end node. 383 * @param nodesVia List<Node>; a number of nodes that the GTU has to pass between nodeFrom and nodeTo in the given 384 * order. 385 * @param linkWeight LinkWeight; link weight. 386 * @return the shortest route between two nodes in the network, via the intermediate nodes. If no path exists from the start 387 * node to the end node via the intermediate nodes in the network, null is returned. 388 * @throws NetworkException in case nodes cannot be added to the route, e.g. because they are not directly connected. This 389 * can be the case when the links in the network have changed, but the graph has not been rebuilt. 390 */ 391 CompleteRoute getShortestRouteBetween(GTUType gtuType, Node nodeFrom, Node nodeTo, List<Node> nodesVia, 392 LinkWeight linkWeight) throws NetworkException; 393 394 /***************************************************************************************/ 395 /********************************** ANIMATION EVENTS ***********************************/ 396 /***************************************************************************************/ 397 398 /** 399 * The timed event type for pub/sub indicating the addition of a Node. <br> 400 * Payload: Node node (not an array, just an Object) 401 */ 402 EventType ANIMATION_NODE_ADD_EVENT = new EventType("ANIMATION.NETWORK.NODE.ADD"); 403 404 /** 405 * The (regular, not timed) event type for pub/sub indicating the removal of a Node. <br> 406 * Payload: Node node (not an array, just an Object) 407 */ 408 EventType ANIMATION_NODE_REMOVE_EVENT = new EventType("ANIMATION.NETWORK.NODE.REMOVE"); 409 410 /** 411 * The (regular, not timed) event type for pub/sub indicating the addition of a Link. <br> 412 * Payload: Link link (not an array, just an Object) 413 */ 414 EventType ANIMATION_LINK_ADD_EVENT = new EventType("ANIMATION.NETWORK.LINK.ADD"); 415 416 /** 417 * The (regular, not timed) event type for pub/sub indicating the removal of a Link. <br> 418 * Payload: Link link (not an array, just an Object) 419 */ 420 EventType ANIMATION_LINK_REMOVE_EVENT = new EventType("ANIMATION.NETWORK.LINK.REMOVE"); 421 422 /** 423 * The (regular, not timed) event type for pub/sub indicating the addition of an ObjectInterface implementing object. <br> 424 * Payload: StaticObject object (not an array, just an Object) 425 */ 426 EventType ANIMATION_OBJECT_ADD_EVENT = new EventType("ANIMATION.NETWORK.OBJECT.ADD"); 427 428 /** 429 * The (regular, not timed) event type for pub/sub indicating the removal of an ObjectInterface implementing object. <br> 430 * Payload: StaticObject object (not an array, just an Object) 431 */ 432 EventType ANIMATION_OBJECT_REMOVE_EVENT = new EventType("ANIMATION.NETWORK.OBJECT.REMOVE"); 433 434 /** 435 * The (regular, not timed) event type for pub/sub indicating the addition of an InvisibleObjectInterface implementing 436 * object. <br> 437 * Payload: InvisibleObject object (not an array, just an Object) 438 */ 439 EventType ANIMATION_INVISIBLE_OBJECT_ADD_EVENT = new EventType("ANIMATION.NETWORK.INVISIBLE_OBJECT.ADD"); 440 441 /** 442 * The (regular, not timed) event type for pub/sub indicating the removal of an InvisibleObjectInterface implementing 443 * object. <br> 444 * Payload: InvisibleObject object (not an array, just an Object) 445 */ 446 EventType ANIMATION_INVISIBLE_OBJECT_REMOVE_EVENT = new EventType("ANIMATION.NETWORK.INVISIBLE_OBJECT.REMOVE"); 447 448 /** 449 * The (regular, not timed) event type for pub/sub indicating the addition of a Route for a gtuType. <br> 450 * Payload: [GTUType gtuType, Route route] 451 */ 452 EventType ANIMATION_ROUTE_ADD_EVENT = new EventType("ANIMATION.NETWORK.ROUTE.ADD"); 453 454 /** 455 * The (regular, not timed) event type for pub/sub indicating the removal of a Route for a gtuType. <br> 456 * Payload: [GTUType gtuType, Route route] 457 */ 458 EventType ANIMATION_ROUTE_REMOVE_EVENT = new EventType("ANIMATION.NETWORK.ROUTE.REMOVE"); 459 460 /** 461 * The <b>timed</b> event type for pub/sub indicating the addition of a GTU to the network. <br> 462 * Payload: GTU gtu (not an array, just an Object) 463 */ 464 EventType ANIMATION_GTU_ADD_EVENT = new EventType("ANIMATION.NETWORK.GTU.ADD"); 465 466 /** 467 * The <b>timed</b> event type for pub/sub indicating the removal of a GTU from the network. <br> 468 * Payload: GTU gtu (not an array, just an Object) 469 */ 470 EventType ANIMATION_GTU_REMOVE_EVENT = new EventType("ANIMATION.NETWORK.GTU.REMOVE"); 471 472 /** 473 * The (regular, not timed) event type for pub/sub indicating the addition of an GTUGenerator implementing object. <br> 474 * Payload: AbstractGTUGenerator object (not an array, just an Object) 475 */ 476 EventType ANIMATION_GENERATOR_ADD_EVENT = new EventType("ANIMATION.NETWORK.GENERATOR.ADD"); 477 478 /** 479 * The (regular, not timed) event type for pub/sub indicating the removal of an GTUGenerator implementing object. <br> 480 * Payload: AbstractGTUGenerator object (not an array, just an Object) 481 */ 482 EventType ANIMATION_GENERATOR_REMOVE_EVENT = new EventType("ANIMATION.NETWORK.GENERATOR.REMOVE"); 483 484 /***************************************************************************************/ 485 /*************************************** EVENTS ****************************************/ 486 /***************************************************************************************/ 487 488 /** 489 * The (regular, not timed) event type for pub/sub indicating the addition of a Node. <br> 490 * Payload: String nodeId (not an array, just a String) 491 */ 492 EventType NODE_ADD_EVENT = new EventType("NETWORK.NODE.ADD"); 493 494 /** 495 * The (regular, not timed) event type for pub/sub indicating the removal of a Node. <br> 496 * Payload: String nodeId (not an array, just a String) 497 */ 498 EventType NODE_REMOVE_EVENT = new EventType("NETWORK.NODE.REMOVE"); 499 500 /** 501 * The (regular, not timed) event type for pub/sub indicating the addition of a Link. <br> 502 * Payload: String linkId (not an array, just a String) 503 */ 504 EventType LINK_ADD_EVENT = new EventType("NETWORK.LINK.ADD"); 505 506 /** 507 * The (regular, not timed) event type for pub/sub indicating the removal of a Link. <br> 508 * Payload: String linkId (not an array, just a String) 509 */ 510 EventType LINK_REMOVE_EVENT = new EventType("NETWORK.LINK.REMOVE"); 511 512 /** 513 * The (regular, not timed) event type for pub/sub indicating the addition of an ObjectInterface implementing object. <br> 514 * Payload: String ObjectId (not an array, just a String) 515 */ 516 EventType OBJECT_ADD_EVENT = new EventType("NETWORK.OBJECT.ADD"); 517 518 /** 519 * The (regular, not timed) event type for pub/sub indicating the removal of an ObjectInterface implementing object. <br> 520 * Payload: String objectId (not an array, just a String) 521 */ 522 EventType OBJECT_REMOVE_EVENT = new EventType("NETWORK.OBJECT.REMOVE"); 523 524 /** 525 * The (regular, not timed) event type for pub/sub indicating the addition of an InvisibleObjectInterface implementing 526 * object. <br> 527 * Payload: String ObjectId (not an array, just a String) 528 */ 529 EventType INVISIBLE_OBJECT_ADD_EVENT = new EventType("NETWORK.INVISIBLE_OBJECT.ADD"); 530 531 /** 532 * The (regular, not timed) event type for pub/sub indicating the removal of an InvisibleObjectInterface implementing 533 * object. <br> 534 * Payload: String objectId (not an array, just a String) 535 */ 536 EventType INVISIBLE_OBJECT_REMOVE_EVENT = new EventType("NETWORK.INVISIBLE_OBJECT.REMOVE"); 537 538 /** 539 * The (regular, not timed) event type for pub/sub indicating the addition of a Route for a gtuType. <br> 540 * Payload: [String gtuTypeId, String routeId] 541 */ 542 EventType ROUTE_ADD_EVENT = new EventType("NETWORK.ROUTE.ADD"); 543 544 /** 545 * The (regular, not timed) event type for pub/sub indicating the removal of a Route for a gtuType. <br> 546 * Payload: [String gtuTypeId, String routeId] 547 */ 548 EventType ROUTE_REMOVE_EVENT = new EventType("NETWORK.ROUTE.REMOVE"); 549 550 /** 551 * The <b>timed</b> event type for pub/sub indicating the addition of a GTU to the network. <br> 552 * Payload: String gtuId (not an array, just a String) 553 */ 554 EventType GTU_ADD_EVENT = new EventType("NETWORK.GTU.ADD"); 555 556 /** 557 * The <b>timed</b> event type for pub/sub indicating the removal of a GTU from the network. <br> 558 * Payload: String gtuId (not an array, just a String) 559 */ 560 EventType GTU_REMOVE_EVENT = new EventType("NETWORK.GTU.REMOVE"); 561 562 /** 563 * The <b>timed</b> event type for pub/sub indicating the addition of a GTUGenerator to the network. <br> 564 * Payload: String generatorName (not an array, just a String) 565 */ 566 EventType GENERATOR_ADD_EVENT = new EventType("NETWORK.GENERATOR.ADD"); 567 568 /** 569 * The <b>timed</b> event type for pub/sub indicating the removal of a GTUGenerator from the network. <br> 570 * Payload: String generatorName (not an array, just a String) 571 */ 572 EventType GENERATOR_REMOVE_EVENT = new EventType("NETWORK.GENERATOR.REMOVE"); 573 }