From 48706eeccc18504dd0d6b04cbeec93d7c27d5035 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Fri, 15 Mar 2024 23:42:27 -0400 Subject: [PATCH] Updating the memory options to 3.1.3 --- schema | 2 +- .../java/org/mujoco/xml/size/SizeType.java | 230 ++++-------------- src/test/java/mujoco/java/XMLtest.java | 2 +- 3 files changed, 45 insertions(+), 189 deletions(-) diff --git a/schema b/schema index 939cf2b..ed31085 160000 --- a/schema +++ b/schema @@ -1 +1 @@ -Subproject commit 939cf2baee60c47d54fd210a78a0afd7e66c1f81 +Subproject commit ed31085fd5298fd7e125f750abeb4d878cf97617 diff --git a/src/main/java/org/mujoco/xml/size/SizeType.java b/src/main/java/org/mujoco/xml/size/SizeType.java index 663fd77..4d78914 100644 --- a/src/main/java/org/mujoco/xml/size/SizeType.java +++ b/src/main/java/org/mujoco/xml/size/SizeType.java @@ -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" /> @@ -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") @@ -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; @@ -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())))) { @@ -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; } } @@ -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) { @@ -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; @@ -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())))) { @@ -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; @@ -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())))) { @@ -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; @@ -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; @@ -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())))) { @@ -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; @@ -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; } @@ -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"; @@ -1109,9 +981,7 @@ public static class Selector extends com.kscs.util.jaxb.Selector { - private com.kscs.util.jaxb.Selector> njmax = null; - private com.kscs.util.jaxb.Selector> nconmax = null; - private com.kscs.util.jaxb.Selector> nstack = null; + private com.kscs.util.jaxb.Selector> memory = null; private com.kscs.util.jaxb.Selector> nuserdata = null; private com.kscs.util.jaxb.Selector> nkey = null; private com.kscs.util.jaxb.Selector> nuserBody = null; @@ -1131,14 +1001,8 @@ public Selector(final TRoot root, final TParent parent, final String propertyNam public Map buildChildren() { final Map products = new HashMap(); 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()); @@ -1173,16 +1037,8 @@ public Map buildChildren() { return products; } - public com.kscs.util.jaxb.Selector> njmax() { - return ((this.njmax == null)?this.njmax = new com.kscs.util.jaxb.Selector>(this._root, this, "njmax"):this.njmax); - } - - public com.kscs.util.jaxb.Selector> nconmax() { - return ((this.nconmax == null)?this.nconmax = new com.kscs.util.jaxb.Selector>(this._root, this, "nconmax"):this.nconmax); - } - - public com.kscs.util.jaxb.Selector> nstack() { - return ((this.nstack == null)?this.nstack = new com.kscs.util.jaxb.Selector>(this._root, this, "nstack"):this.nstack); + public com.kscs.util.jaxb.Selector> memory() { + return ((this.memory == null)?this.memory = new com.kscs.util.jaxb.Selector>(this._root, this, "memory"):this.memory); } public com.kscs.util.jaxb.Selector> nuserdata() { diff --git a/src/test/java/mujoco/java/XMLtest.java b/src/test/java/mujoco/java/XMLtest.java index 7f1d96e..7ffc566 100644 --- a/src/test/java/mujoco/java/XMLtest.java +++ b/src/test/java/mujoco/java/XMLtest.java @@ -35,7 +35,7 @@ public void marshal() throws JAXBException, IOException, InterruptedException { Mujoco.Builder builder = Mujoco.builder() .withModel("Test Robot") ; - + builder.addSize().withMemory("100M"); builder.addOption() .withTimestep(new BigDecimal(0.005)); builder.addVisual()