Skip to content

Commit

Permalink
Updating the memory options to 3.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Mar 16, 2024
1 parent fe482c0 commit 48706ee
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 189 deletions.
2 changes: 1 addition & 1 deletion schema
Submodule schema updated 1 files
+1 −3 element_types/size.xsd
230 changes: 43 additions & 187 deletions src/main/java/org/mujoco/xml/size/SizeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
* <complexType name="sizeType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attribute name="njmax" type="{http://www.w3.org/2001/XMLSchema}int" default="-1" />
* <attribute name="nconmax" type="{http://www.w3.org/2001/XMLSchema}int" default="-1" />
* <attribute name="nstack" type="{http://www.w3.org/2001/XMLSchema}int" default="-1" />
* <attribute name="memory" type="{http://www.w3.org/2001/XMLSchema}string" default="-1" />
* <attribute name="nuserdata" type="{http://www.w3.org/2001/XMLSchema}int" default="0" />
* <attribute name="nkey" type="{http://www.w3.org/2001/XMLSchema}int" default="0" />
* <attribute name="nuser_body" type="{http://www.w3.org/2001/XMLSchema}int" default="0" />
Expand All @@ -60,12 +58,8 @@
public class SizeType implements Cloneable, Copyable, PartialCopyable
{

@XmlAttribute(name = "njmax")
protected Integer njmax;
@XmlAttribute(name = "nconmax")
protected Integer nconmax;
@XmlAttribute(name = "nstack")
protected Integer nstack;
@XmlAttribute(name = "memory")
protected String memory;
@XmlAttribute(name = "nuserdata")
protected Integer nuserdata;
@XmlAttribute(name = "nkey")
Expand Down Expand Up @@ -104,9 +98,7 @@ public SizeType() {
* The original SizeType from which to copy state.
*/
public SizeType(final SizeType _other) {
this.njmax = _other.njmax;
this.nconmax = _other.nconmax;
this.nstack = _other.nstack;
this.memory = _other.memory;
this.nuserdata = _other.nuserdata;
this.nkey = _other.nkey;
this.nuserBody = _other.nuserBody;
Expand All @@ -130,17 +122,9 @@ public SizeType(final SizeType _other) {
* The original SizeType from which to copy state.
*/
public SizeType(final SizeType _other, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) {
final PropertyTree njmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("njmax"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(njmaxPropertyTree!= null):((njmaxPropertyTree == null)||(!njmaxPropertyTree.isLeaf())))) {
this.njmax = _other.njmax;
}
final PropertyTree nconmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nconmax"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nconmaxPropertyTree!= null):((nconmaxPropertyTree == null)||(!nconmaxPropertyTree.isLeaf())))) {
this.nconmax = _other.nconmax;
}
final PropertyTree nstackPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nstack"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nstackPropertyTree!= null):((nstackPropertyTree == null)||(!nstackPropertyTree.isLeaf())))) {
this.nstack = _other.nstack;
final PropertyTree memoryPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("memory"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(memoryPropertyTree!= null):((memoryPropertyTree == null)||(!memoryPropertyTree.isLeaf())))) {
this.memory = _other.memory;
}
final PropertyTree nuserdataPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nuserdata"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nuserdataPropertyTree!= null):((nuserdataPropertyTree == null)||(!nuserdataPropertyTree.isLeaf())))) {
Expand Down Expand Up @@ -185,50 +169,18 @@ public SizeType(final SizeType _other, final PropertyTree _propertyTree, final P
}

/**
* Gets the value of the njmax property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public int getNjmax() {
if (njmax == null) {
return -1;
} else {
return njmax;
}
}

/**
* Gets the value of the nconmax property.
* Gets the value of the memory property.
*
* @return
* possible object is
* {@link Integer }
* {@link String }
*
*/
public int getNconmax() {
if (nconmax == null) {
return -1;
public String getMemory() {
if (memory == null) {
return "-1";
} else {
return nconmax;
}
}

/**
* Gets the value of the nstack property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public int getNstack() {
if (nstack == null) {
return -1;
} else {
return nstack;
return memory;
}
}

Expand Down Expand Up @@ -418,37 +370,15 @@ public SizeType withPropertyChangeListener(final PropertyChangeListener property
return this;
}

public void setNjmax(final Integer value) {
final Integer __oldValue = this.njmax;
try {
this.vetoableChange__Support.fireVetoableChange("njmax", __oldValue, value);
} catch (PropertyVetoException x) {
throw new RuntimeException(x);
}
this.njmax = value;
this.propertyChange__Support.firePropertyChange("njmax", __oldValue, value);
}

public void setNconmax(final Integer value) {
final Integer __oldValue = this.nconmax;
public void setMemory(final String value) {
final String __oldValue = this.memory;
try {
this.vetoableChange__Support.fireVetoableChange("nconmax", __oldValue, value);
this.vetoableChange__Support.fireVetoableChange("memory", __oldValue, value);
} catch (PropertyVetoException x) {
throw new RuntimeException(x);
}
this.nconmax = value;
this.propertyChange__Support.firePropertyChange("nconmax", __oldValue, value);
}

public void setNstack(final Integer value) {
final Integer __oldValue = this.nstack;
try {
this.vetoableChange__Support.fireVetoableChange("nstack", __oldValue, value);
} catch (PropertyVetoException x) {
throw new RuntimeException(x);
}
this.nstack = value;
this.propertyChange__Support.firePropertyChange("nstack", __oldValue, value);
this.memory = value;
this.propertyChange__Support.firePropertyChange("memory", __oldValue, value);
}

public void setNuserdata(final Integer value) {
Expand Down Expand Up @@ -580,9 +510,7 @@ public SizeType createCopy() {
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
_newObject.njmax = this.njmax;
_newObject.nconmax = this.nconmax;
_newObject.nstack = this.nstack;
_newObject.memory = this.memory;
_newObject.nuserdata = this.nuserdata;
_newObject.nkey = this.nkey;
_newObject.nuserBody = this.nuserBody;
Expand All @@ -604,17 +532,9 @@ public SizeType createCopy(final PropertyTree _propertyTree, final PropertyTreeU
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
final PropertyTree njmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("njmax"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(njmaxPropertyTree!= null):((njmaxPropertyTree == null)||(!njmaxPropertyTree.isLeaf())))) {
_newObject.njmax = this.njmax;
}
final PropertyTree nconmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nconmax"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nconmaxPropertyTree!= null):((nconmaxPropertyTree == null)||(!nconmaxPropertyTree.isLeaf())))) {
_newObject.nconmax = this.nconmax;
}
final PropertyTree nstackPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nstack"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nstackPropertyTree!= null):((nstackPropertyTree == null)||(!nstackPropertyTree.isLeaf())))) {
_newObject.nstack = this.nstack;
final PropertyTree memoryPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("memory"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(memoryPropertyTree!= null):((memoryPropertyTree == null)||(!memoryPropertyTree.isLeaf())))) {
_newObject.memory = this.memory;
}
final PropertyTree nuserdataPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nuserdata"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nuserdataPropertyTree!= null):((nuserdataPropertyTree == null)||(!nuserdataPropertyTree.isLeaf())))) {
Expand Down Expand Up @@ -676,9 +596,7 @@ public SizeType copyOnly(final PropertyTree _propertyTree) {
* A builder instance to which the state of this object will be copied.
*/
public<_B >void copyTo(final SizeType.Builder<_B> _other) {
_other.njmax = this.njmax;
_other.nconmax = this.nconmax;
_other.nstack = this.nstack;
_other.memory = this.memory;
_other.nuserdata = this.nuserdata;
_other.nkey = this.nkey;
_other.nuserBody = this.nuserBody;
Expand Down Expand Up @@ -716,17 +634,9 @@ public static<_B >SizeType.Builder<_B> copyOf(final SizeType _other) {
* A builder instance to which the state of this object will be copied.
*/
public<_B >void copyTo(final SizeType.Builder<_B> _other, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) {
final PropertyTree njmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("njmax"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(njmaxPropertyTree!= null):((njmaxPropertyTree == null)||(!njmaxPropertyTree.isLeaf())))) {
_other.njmax = this.njmax;
}
final PropertyTree nconmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nconmax"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nconmaxPropertyTree!= null):((nconmaxPropertyTree == null)||(!nconmaxPropertyTree.isLeaf())))) {
_other.nconmax = this.nconmax;
}
final PropertyTree nstackPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nstack"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nstackPropertyTree!= null):((nstackPropertyTree == null)||(!nstackPropertyTree.isLeaf())))) {
_other.nstack = this.nstack;
final PropertyTree memoryPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("memory"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(memoryPropertyTree!= null):((memoryPropertyTree == null)||(!memoryPropertyTree.isLeaf())))) {
_other.memory = this.memory;
}
final PropertyTree nuserdataPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nuserdata"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nuserdataPropertyTree!= null):((nuserdataPropertyTree == null)||(!nuserdataPropertyTree.isLeaf())))) {
Expand Down Expand Up @@ -801,9 +711,7 @@ public static class Builder<_B >implements Buildable
{

protected final _B _parentBuilder;
private Integer njmax;
private Integer nconmax;
private Integer nstack;
private String memory;
private Integer nuserdata;
private Integer nkey;
private Integer nuserBody;
Expand All @@ -818,9 +726,7 @@ public static class Builder<_B >implements Buildable
public Builder(final _B _parentBuilder, final SizeType _other, final boolean _copy) {
this._parentBuilder = _parentBuilder;
if (_other!= null) {
this.njmax = _other.njmax;
this.nconmax = _other.nconmax;
this.nstack = _other.nstack;
this.memory = _other.memory;
this.nuserdata = _other.nuserdata;
this.nkey = _other.nkey;
this.nuserBody = _other.nuserBody;
Expand All @@ -837,17 +743,9 @@ public Builder(final _B _parentBuilder, final SizeType _other, final boolean _co
public Builder(final _B _parentBuilder, final SizeType _other, final boolean _copy, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) {
this._parentBuilder = _parentBuilder;
if (_other!= null) {
final PropertyTree njmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("njmax"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(njmaxPropertyTree!= null):((njmaxPropertyTree == null)||(!njmaxPropertyTree.isLeaf())))) {
this.njmax = _other.njmax;
}
final PropertyTree nconmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nconmax"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nconmaxPropertyTree!= null):((nconmaxPropertyTree == null)||(!nconmaxPropertyTree.isLeaf())))) {
this.nconmax = _other.nconmax;
}
final PropertyTree nstackPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nstack"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nstackPropertyTree!= null):((nstackPropertyTree == null)||(!nstackPropertyTree.isLeaf())))) {
this.nstack = _other.nstack;
final PropertyTree memoryPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("memory"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(memoryPropertyTree!= null):((memoryPropertyTree == null)||(!memoryPropertyTree.isLeaf())))) {
this.memory = _other.memory;
}
final PropertyTree nuserdataPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nuserdata"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nuserdataPropertyTree!= null):((nuserdataPropertyTree == null)||(!nuserdataPropertyTree.isLeaf())))) {
Expand Down Expand Up @@ -897,9 +795,7 @@ public _B end() {
}

protected<_P extends SizeType >_P init(final _P _product) {
_product.njmax = this.njmax;
_product.nconmax = this.nconmax;
_product.nstack = this.nstack;
_product.memory = this.memory;
_product.nuserdata = this.nuserdata;
_product.nkey = this.nkey;
_product.nuserBody = this.nuserBody;
Expand All @@ -914,35 +810,13 @@ protected<_P extends SizeType >_P init(final _P _product) {
}

/**
* Sets the new value of "njmax" (any previous value will be replaced)
*
* @param njmax
* New value of the "njmax" property.
*/
public SizeType.Builder<_B> withNjmax(final Integer njmax) {
this.njmax = njmax;
return this;
}

/**
* Sets the new value of "nconmax" (any previous value will be replaced)
* Sets the new value of "memory" (any previous value will be replaced)
*
* @param nconmax
* New value of the "nconmax" property.
* @param memory
* New value of the "memory" property.
*/
public SizeType.Builder<_B> withNconmax(final Integer nconmax) {
this.nconmax = nconmax;
return this;
}

/**
* Sets the new value of "nstack" (any previous value will be replaced)
*
* @param nstack
* New value of the "nstack" property.
*/
public SizeType.Builder<_B> withNstack(final Integer nstack) {
this.nstack = nstack;
public SizeType.Builder<_B> withMemory(final String memory) {
this.memory = memory;
return this;
}

Expand Down Expand Up @@ -1074,9 +948,7 @@ public SizeType.Builder<_B> copyOf(final SizeType.Builder _other) {

public static class PropInfo {

public final static transient String NJMAX = "njmax";
public final static transient String NCONMAX = "nconmax";
public final static transient String NSTACK = "nstack";
public final static transient String MEMORY = "memory";
public final static transient String NUSERDATA = "nuserdata";
public final static transient String NKEY = "nkey";
public final static transient String NUSER_BODY = "nuserBody";
Expand Down Expand Up @@ -1109,9 +981,7 @@ public static class Selector<TRoot extends com.kscs.util.jaxb.Selector<TRoot, ?>
extends com.kscs.util.jaxb.Selector<TRoot, TParent>
{

private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> njmax = null;
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nconmax = null;
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nstack = null;
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> memory = null;
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nuserdata = null;
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nkey = null;
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nuserBody = null;
Expand All @@ -1131,14 +1001,8 @@ public Selector(final TRoot root, final TParent parent, final String propertyNam
public Map<String, PropertyTree> buildChildren() {
final Map<String, PropertyTree> products = new HashMap<String, PropertyTree>();
products.putAll(super.buildChildren());
if (this.njmax!= null) {
products.put("njmax", this.njmax.init());
}
if (this.nconmax!= null) {
products.put("nconmax", this.nconmax.init());
}
if (this.nstack!= null) {
products.put("nstack", this.nstack.init());
if (this.memory!= null) {
products.put("memory", this.memory.init());
}
if (this.nuserdata!= null) {
products.put("nuserdata", this.nuserdata.init());
Expand Down Expand Up @@ -1173,16 +1037,8 @@ public Map<String, PropertyTree> buildChildren() {
return products;
}

public com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> njmax() {
return ((this.njmax == null)?this.njmax = new com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>>(this._root, this, "njmax"):this.njmax);
}

public com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nconmax() {
return ((this.nconmax == null)?this.nconmax = new com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>>(this._root, this, "nconmax"):this.nconmax);
}

public com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nstack() {
return ((this.nstack == null)?this.nstack = new com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>>(this._root, this, "nstack"):this.nstack);
public com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> memory() {
return ((this.memory == null)?this.memory = new com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>>(this._root, this, "memory"):this.memory);
}

public com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nuserdata() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/mujoco/java/XMLtest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void marshal() throws JAXBException, IOException, InterruptedException {
Mujoco.Builder<Void> builder = Mujoco.builder()
.withModel("Test Robot")
;

builder.addSize().withMemory("100M");
builder.addOption()
.withTimestep(new BigDecimal(0.005));
builder.addVisual()
Expand Down

0 comments on commit 48706ee

Please sign in to comment.