22 package org.matsim.core.mobsim.qsim.qnetsimengine;
24 import java.util.HashMap;
26 import java.util.concurrent.atomic.AtomicBoolean;
36 abstract class AbstractQNode
implements QNodeI {
39 private NetElementActivationRegistry activator = null;
47 private final AtomicBoolean active =
new AtomicBoolean(
false);
50 private final Map<String, Object> customAttributes =
new HashMap<>();
56 AbstractQNode(
final Node n){
62 public Node getNode() {
70 void setNetElementActivationRegistry(NetElementActivationRegistry activator) {
74 this.activator = activator;
84 final void activateNode() {
93 if (this.active.compareAndSet(
false,
true)) {
94 this.activator.registerNodeAsActive(
this);
98 final boolean isActive() {
102 return this.active.get();
105 void setActive(
boolean active) {
106 this.active.set(active);
111 public final Map<String, Object> getCustomAttributes() {
112 return customAttributes;