Commit 9087920e authored by Jakob Schöttl's avatar Jakob Schöttl
Browse files

Make attributes sealable

parent 7688aaf7
......@@ -31,5 +31,10 @@
<artifactId>utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-attributes</groupId>
<artifactId>commons-attributes-api</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</project>
......@@ -2,6 +2,7 @@ package org.vadere.state.attributes;
import java.lang.reflect.Field;
import org.apache.commons.attributes.DefaultSealable;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
......@@ -12,7 +13,7 @@ import com.google.gson.JsonElement;
*
*
*/
public abstract class Attributes {
public abstract class Attributes extends DefaultSealable {
public Attributes() {}
......
......@@ -7,7 +7,6 @@ import org.vadere.util.reflection.DynamicClassInstantiator;
/**
* POJO for the model definition.
*
*
*/
public class ModelDefinition {
......
......@@ -13,6 +13,7 @@ public class AttributesPedestrianDensityCountingProcessor extends AttributesPede
}
public void setRadius(double radius) {
checkSealed();
this.radius = radius;
}
}
......@@ -13,6 +13,7 @@ public class AttributesPedestrianDensityProcessor extends AttributesProcessor {
}
public void setPedestrianPositionProcessorId(int pedestrianPositionProcessorId) {
checkSealed();
this.pedestrianPositionProcessorId = pedestrianPositionProcessorId;
}
}
......@@ -14,6 +14,7 @@ public class AttributesPedestrianVelocityProcessor extends AttributesProcessor {
}
public void setPedestrianPositionProcessorId(int pedestrianPositionProcessorId) {
checkSealed();
this.pedestrianPositionProcessorId = pedestrianPositionProcessorId;
}
......@@ -22,6 +23,7 @@ public class AttributesPedestrianVelocityProcessor extends AttributesProcessor {
}
public void setBackSteps(int backSteps) {
checkSealed();
this.backSteps = backSteps;
}
}
......@@ -39,9 +39,11 @@ public class AttributesCar extends AttributesAgent {
}
public void setDirection(Vector2D direction) {
checkSealed();
this.direction = direction;
}
@Override
public double getRadius() {
if (width >= length) {
return width;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment