Skip to content

Commit 48706ee

Browse files
committed
Updating the memory options to 3.1.3
1 parent fe482c0 commit 48706ee

File tree

3 files changed

+45
-189
lines changed

3 files changed

+45
-189
lines changed

schema

src/main/java/org/mujoco/xml/size/SizeType.java

Lines changed: 43 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
* <complexType name="sizeType">
3636
* <complexContent>
3737
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
38-
* <attribute name="njmax" type="{http://www.w3.org/2001/XMLSchema}int" default="-1" />
39-
* <attribute name="nconmax" type="{http://www.w3.org/2001/XMLSchema}int" default="-1" />
40-
* <attribute name="nstack" type="{http://www.w3.org/2001/XMLSchema}int" default="-1" />
38+
* <attribute name="memory" type="{http://www.w3.org/2001/XMLSchema}string" default="-1" />
4139
* <attribute name="nuserdata" type="{http://www.w3.org/2001/XMLSchema}int" default="0" />
4240
* <attribute name="nkey" type="{http://www.w3.org/2001/XMLSchema}int" default="0" />
4341
* <attribute name="nuser_body" type="{http://www.w3.org/2001/XMLSchema}int" default="0" />
@@ -60,12 +58,8 @@
6058
public class SizeType implements Cloneable, Copyable, PartialCopyable
6159
{
6260

63-
@XmlAttribute(name = "njmax")
64-
protected Integer njmax;
65-
@XmlAttribute(name = "nconmax")
66-
protected Integer nconmax;
67-
@XmlAttribute(name = "nstack")
68-
protected Integer nstack;
61+
@XmlAttribute(name = "memory")
62+
protected String memory;
6963
@XmlAttribute(name = "nuserdata")
7064
protected Integer nuserdata;
7165
@XmlAttribute(name = "nkey")
@@ -104,9 +98,7 @@ public SizeType() {
10498
* The original SizeType from which to copy state.
10599
*/
106100
public SizeType(final SizeType _other) {
107-
this.njmax = _other.njmax;
108-
this.nconmax = _other.nconmax;
109-
this.nstack = _other.nstack;
101+
this.memory = _other.memory;
110102
this.nuserdata = _other.nuserdata;
111103
this.nkey = _other.nkey;
112104
this.nuserBody = _other.nuserBody;
@@ -130,17 +122,9 @@ public SizeType(final SizeType _other) {
130122
* The original SizeType from which to copy state.
131123
*/
132124
public SizeType(final SizeType _other, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) {
133-
final PropertyTree njmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("njmax"));
134-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(njmaxPropertyTree!= null):((njmaxPropertyTree == null)||(!njmaxPropertyTree.isLeaf())))) {
135-
this.njmax = _other.njmax;
136-
}
137-
final PropertyTree nconmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nconmax"));
138-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nconmaxPropertyTree!= null):((nconmaxPropertyTree == null)||(!nconmaxPropertyTree.isLeaf())))) {
139-
this.nconmax = _other.nconmax;
140-
}
141-
final PropertyTree nstackPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nstack"));
142-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nstackPropertyTree!= null):((nstackPropertyTree == null)||(!nstackPropertyTree.isLeaf())))) {
143-
this.nstack = _other.nstack;
125+
final PropertyTree memoryPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("memory"));
126+
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(memoryPropertyTree!= null):((memoryPropertyTree == null)||(!memoryPropertyTree.isLeaf())))) {
127+
this.memory = _other.memory;
144128
}
145129
final PropertyTree nuserdataPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nuserdata"));
146130
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nuserdataPropertyTree!= null):((nuserdataPropertyTree == null)||(!nuserdataPropertyTree.isLeaf())))) {
@@ -185,50 +169,18 @@ public SizeType(final SizeType _other, final PropertyTree _propertyTree, final P
185169
}
186170

187171
/**
188-
* Gets the value of the njmax property.
189-
*
190-
* @return
191-
* possible object is
192-
* {@link Integer }
193-
*
194-
*/
195-
public int getNjmax() {
196-
if (njmax == null) {
197-
return -1;
198-
} else {
199-
return njmax;
200-
}
201-
}
202-
203-
/**
204-
* Gets the value of the nconmax property.
172+
* Gets the value of the memory property.
205173
*
206174
* @return
207175
* possible object is
208-
* {@link Integer }
176+
* {@link String }
209177
*
210178
*/
211-
public int getNconmax() {
212-
if (nconmax == null) {
213-
return -1;
179+
public String getMemory() {
180+
if (memory == null) {
181+
return "-1";
214182
} else {
215-
return nconmax;
216-
}
217-
}
218-
219-
/**
220-
* Gets the value of the nstack property.
221-
*
222-
* @return
223-
* possible object is
224-
* {@link Integer }
225-
*
226-
*/
227-
public int getNstack() {
228-
if (nstack == null) {
229-
return -1;
230-
} else {
231-
return nstack;
183+
return memory;
232184
}
233185
}
234186

@@ -418,37 +370,15 @@ public SizeType withPropertyChangeListener(final PropertyChangeListener property
418370
return this;
419371
}
420372

421-
public void setNjmax(final Integer value) {
422-
final Integer __oldValue = this.njmax;
423-
try {
424-
this.vetoableChange__Support.fireVetoableChange("njmax", __oldValue, value);
425-
} catch (PropertyVetoException x) {
426-
throw new RuntimeException(x);
427-
}
428-
this.njmax = value;
429-
this.propertyChange__Support.firePropertyChange("njmax", __oldValue, value);
430-
}
431-
432-
public void setNconmax(final Integer value) {
433-
final Integer __oldValue = this.nconmax;
373+
public void setMemory(final String value) {
374+
final String __oldValue = this.memory;
434375
try {
435-
this.vetoableChange__Support.fireVetoableChange("nconmax", __oldValue, value);
376+
this.vetoableChange__Support.fireVetoableChange("memory", __oldValue, value);
436377
} catch (PropertyVetoException x) {
437378
throw new RuntimeException(x);
438379
}
439-
this.nconmax = value;
440-
this.propertyChange__Support.firePropertyChange("nconmax", __oldValue, value);
441-
}
442-
443-
public void setNstack(final Integer value) {
444-
final Integer __oldValue = this.nstack;
445-
try {
446-
this.vetoableChange__Support.fireVetoableChange("nstack", __oldValue, value);
447-
} catch (PropertyVetoException x) {
448-
throw new RuntimeException(x);
449-
}
450-
this.nstack = value;
451-
this.propertyChange__Support.firePropertyChange("nstack", __oldValue, value);
380+
this.memory = value;
381+
this.propertyChange__Support.firePropertyChange("memory", __oldValue, value);
452382
}
453383

454384
public void setNuserdata(final Integer value) {
@@ -580,9 +510,7 @@ public SizeType createCopy() {
580510
} catch (CloneNotSupportedException e) {
581511
throw new RuntimeException(e);
582512
}
583-
_newObject.njmax = this.njmax;
584-
_newObject.nconmax = this.nconmax;
585-
_newObject.nstack = this.nstack;
513+
_newObject.memory = this.memory;
586514
_newObject.nuserdata = this.nuserdata;
587515
_newObject.nkey = this.nkey;
588516
_newObject.nuserBody = this.nuserBody;
@@ -604,17 +532,9 @@ public SizeType createCopy(final PropertyTree _propertyTree, final PropertyTreeU
604532
} catch (CloneNotSupportedException e) {
605533
throw new RuntimeException(e);
606534
}
607-
final PropertyTree njmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("njmax"));
608-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(njmaxPropertyTree!= null):((njmaxPropertyTree == null)||(!njmaxPropertyTree.isLeaf())))) {
609-
_newObject.njmax = this.njmax;
610-
}
611-
final PropertyTree nconmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nconmax"));
612-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nconmaxPropertyTree!= null):((nconmaxPropertyTree == null)||(!nconmaxPropertyTree.isLeaf())))) {
613-
_newObject.nconmax = this.nconmax;
614-
}
615-
final PropertyTree nstackPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nstack"));
616-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nstackPropertyTree!= null):((nstackPropertyTree == null)||(!nstackPropertyTree.isLeaf())))) {
617-
_newObject.nstack = this.nstack;
535+
final PropertyTree memoryPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("memory"));
536+
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(memoryPropertyTree!= null):((memoryPropertyTree == null)||(!memoryPropertyTree.isLeaf())))) {
537+
_newObject.memory = this.memory;
618538
}
619539
final PropertyTree nuserdataPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nuserdata"));
620540
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nuserdataPropertyTree!= null):((nuserdataPropertyTree == null)||(!nuserdataPropertyTree.isLeaf())))) {
@@ -676,9 +596,7 @@ public SizeType copyOnly(final PropertyTree _propertyTree) {
676596
* A builder instance to which the state of this object will be copied.
677597
*/
678598
public<_B >void copyTo(final SizeType.Builder<_B> _other) {
679-
_other.njmax = this.njmax;
680-
_other.nconmax = this.nconmax;
681-
_other.nstack = this.nstack;
599+
_other.memory = this.memory;
682600
_other.nuserdata = this.nuserdata;
683601
_other.nkey = this.nkey;
684602
_other.nuserBody = this.nuserBody;
@@ -716,17 +634,9 @@ public static<_B >SizeType.Builder<_B> copyOf(final SizeType _other) {
716634
* A builder instance to which the state of this object will be copied.
717635
*/
718636
public<_B >void copyTo(final SizeType.Builder<_B> _other, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) {
719-
final PropertyTree njmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("njmax"));
720-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(njmaxPropertyTree!= null):((njmaxPropertyTree == null)||(!njmaxPropertyTree.isLeaf())))) {
721-
_other.njmax = this.njmax;
722-
}
723-
final PropertyTree nconmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nconmax"));
724-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nconmaxPropertyTree!= null):((nconmaxPropertyTree == null)||(!nconmaxPropertyTree.isLeaf())))) {
725-
_other.nconmax = this.nconmax;
726-
}
727-
final PropertyTree nstackPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nstack"));
728-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nstackPropertyTree!= null):((nstackPropertyTree == null)||(!nstackPropertyTree.isLeaf())))) {
729-
_other.nstack = this.nstack;
637+
final PropertyTree memoryPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("memory"));
638+
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(memoryPropertyTree!= null):((memoryPropertyTree == null)||(!memoryPropertyTree.isLeaf())))) {
639+
_other.memory = this.memory;
730640
}
731641
final PropertyTree nuserdataPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nuserdata"));
732642
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nuserdataPropertyTree!= null):((nuserdataPropertyTree == null)||(!nuserdataPropertyTree.isLeaf())))) {
@@ -801,9 +711,7 @@ public static class Builder<_B >implements Buildable
801711
{
802712

803713
protected final _B _parentBuilder;
804-
private Integer njmax;
805-
private Integer nconmax;
806-
private Integer nstack;
714+
private String memory;
807715
private Integer nuserdata;
808716
private Integer nkey;
809717
private Integer nuserBody;
@@ -818,9 +726,7 @@ public static class Builder<_B >implements Buildable
818726
public Builder(final _B _parentBuilder, final SizeType _other, final boolean _copy) {
819727
this._parentBuilder = _parentBuilder;
820728
if (_other!= null) {
821-
this.njmax = _other.njmax;
822-
this.nconmax = _other.nconmax;
823-
this.nstack = _other.nstack;
729+
this.memory = _other.memory;
824730
this.nuserdata = _other.nuserdata;
825731
this.nkey = _other.nkey;
826732
this.nuserBody = _other.nuserBody;
@@ -837,17 +743,9 @@ public Builder(final _B _parentBuilder, final SizeType _other, final boolean _co
837743
public Builder(final _B _parentBuilder, final SizeType _other, final boolean _copy, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) {
838744
this._parentBuilder = _parentBuilder;
839745
if (_other!= null) {
840-
final PropertyTree njmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("njmax"));
841-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(njmaxPropertyTree!= null):((njmaxPropertyTree == null)||(!njmaxPropertyTree.isLeaf())))) {
842-
this.njmax = _other.njmax;
843-
}
844-
final PropertyTree nconmaxPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nconmax"));
845-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nconmaxPropertyTree!= null):((nconmaxPropertyTree == null)||(!nconmaxPropertyTree.isLeaf())))) {
846-
this.nconmax = _other.nconmax;
847-
}
848-
final PropertyTree nstackPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nstack"));
849-
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nstackPropertyTree!= null):((nstackPropertyTree == null)||(!nstackPropertyTree.isLeaf())))) {
850-
this.nstack = _other.nstack;
746+
final PropertyTree memoryPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("memory"));
747+
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(memoryPropertyTree!= null):((memoryPropertyTree == null)||(!memoryPropertyTree.isLeaf())))) {
748+
this.memory = _other.memory;
851749
}
852750
final PropertyTree nuserdataPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("nuserdata"));
853751
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(nuserdataPropertyTree!= null):((nuserdataPropertyTree == null)||(!nuserdataPropertyTree.isLeaf())))) {
@@ -897,9 +795,7 @@ public _B end() {
897795
}
898796

899797
protected<_P extends SizeType >_P init(final _P _product) {
900-
_product.njmax = this.njmax;
901-
_product.nconmax = this.nconmax;
902-
_product.nstack = this.nstack;
798+
_product.memory = this.memory;
903799
_product.nuserdata = this.nuserdata;
904800
_product.nkey = this.nkey;
905801
_product.nuserBody = this.nuserBody;
@@ -914,35 +810,13 @@ protected<_P extends SizeType >_P init(final _P _product) {
914810
}
915811

916812
/**
917-
* Sets the new value of "njmax" (any previous value will be replaced)
918-
*
919-
* @param njmax
920-
* New value of the "njmax" property.
921-
*/
922-
public SizeType.Builder<_B> withNjmax(final Integer njmax) {
923-
this.njmax = njmax;
924-
return this;
925-
}
926-
927-
/**
928-
* Sets the new value of "nconmax" (any previous value will be replaced)
813+
* Sets the new value of "memory" (any previous value will be replaced)
929814
*
930-
* @param nconmax
931-
* New value of the "nconmax" property.
815+
* @param memory
816+
* New value of the "memory" property.
932817
*/
933-
public SizeType.Builder<_B> withNconmax(final Integer nconmax) {
934-
this.nconmax = nconmax;
935-
return this;
936-
}
937-
938-
/**
939-
* Sets the new value of "nstack" (any previous value will be replaced)
940-
*
941-
* @param nstack
942-
* New value of the "nstack" property.
943-
*/
944-
public SizeType.Builder<_B> withNstack(final Integer nstack) {
945-
this.nstack = nstack;
818+
public SizeType.Builder<_B> withMemory(final String memory) {
819+
this.memory = memory;
946820
return this;
947821
}
948822

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

1075949
public static class PropInfo {
1076950

1077-
public final static transient String NJMAX = "njmax";
1078-
public final static transient String NCONMAX = "nconmax";
1079-
public final static transient String NSTACK = "nstack";
951+
public final static transient String MEMORY = "memory";
1080952
public final static transient String NUSERDATA = "nuserdata";
1081953
public final static transient String NKEY = "nkey";
1082954
public final static transient String NUSER_BODY = "nuserBody";
@@ -1109,9 +981,7 @@ public static class Selector<TRoot extends com.kscs.util.jaxb.Selector<TRoot, ?>
1109981
extends com.kscs.util.jaxb.Selector<TRoot, TParent>
1110982
{
1111983

1112-
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> njmax = null;
1113-
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nconmax = null;
1114-
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nstack = null;
984+
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> memory = null;
1115985
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nuserdata = null;
1116986
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nkey = null;
1117987
private com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nuserBody = null;
@@ -1131,14 +1001,8 @@ public Selector(final TRoot root, final TParent parent, final String propertyNam
11311001
public Map<String, PropertyTree> buildChildren() {
11321002
final Map<String, PropertyTree> products = new HashMap<String, PropertyTree>();
11331003
products.putAll(super.buildChildren());
1134-
if (this.njmax!= null) {
1135-
products.put("njmax", this.njmax.init());
1136-
}
1137-
if (this.nconmax!= null) {
1138-
products.put("nconmax", this.nconmax.init());
1139-
}
1140-
if (this.nstack!= null) {
1141-
products.put("nstack", this.nstack.init());
1004+
if (this.memory!= null) {
1005+
products.put("memory", this.memory.init());
11421006
}
11431007
if (this.nuserdata!= null) {
11441008
products.put("nuserdata", this.nuserdata.init());
@@ -1173,16 +1037,8 @@ public Map<String, PropertyTree> buildChildren() {
11731037
return products;
11741038
}
11751039

1176-
public com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> njmax() {
1177-
return ((this.njmax == null)?this.njmax = new com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>>(this._root, this, "njmax"):this.njmax);
1178-
}
1179-
1180-
public com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nconmax() {
1181-
return ((this.nconmax == null)?this.nconmax = new com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>>(this._root, this, "nconmax"):this.nconmax);
1182-
}
1183-
1184-
public com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nstack() {
1185-
return ((this.nstack == null)?this.nstack = new com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>>(this._root, this, "nstack"):this.nstack);
1040+
public com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> memory() {
1041+
return ((this.memory == null)?this.memory = new com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>>(this._root, this, "memory"):this.memory);
11861042
}
11871043

11881044
public com.kscs.util.jaxb.Selector<TRoot, SizeType.Selector<TRoot, TParent>> nuserdata() {

src/test/java/mujoco/java/XMLtest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void marshal() throws JAXBException, IOException, InterruptedException {
3535
Mujoco.Builder<Void> builder = Mujoco.builder()
3636
.withModel("Test Robot")
3737
;
38-
38+
builder.addSize().withMemory("100M");
3939
builder.addOption()
4040
.withTimestep(new BigDecimal(0.005));
4141
builder.addVisual()

0 commit comments

Comments
 (0)