Changes Report

Release History

Version Date Description
3.01.04 2019-04-22 XSD generates unit patterns
3.01.03 2019-04-21 DirectionUnit human readable improved
3.01.02 2019-04-01 DirectionUnit repaired; serializable
3.01.01 2019-03-16 stringOf methods have space between number and unit
3.01.00 2019-03-02 Unit constructor and localizations changed
3.00.09 2019-02-27 valueOf and stringOf
3.00.08 2019-01-17 javadoc
3.00.07 2018-08-11 setDisplayUnit method added to all value types
3.00.06 2018-08-10 hashCode and equals for MoneyUnit changed
3.00.05 2018-08-10 hashCodes for Units changed
3.00.04 2018-08-09 get(r,c) added to Matrix interface
3.00.03 2018-01-28 toArray() function added to Vector and FloatVector
3.00.02 2018-01-28 Iterator added to Vector and FloatVector
3.00.01 2017-04-29 Several absolute base units added
3.00.00 2017-04-27 Absolute units separate from relative units
2.02.00 2017-04-17 Units added to create consistency
2.01.03 2017-01-30 createSI() method added to scalars; scalar constants added
2.01.02 2017-01-24 Small changes to AbstractDoubleScalar and AbstractFloatScalar
2.01.01 2016-11-14 neg() function added; cleaned up code
2.01.00 2016-11-01 Increased speed of instantiation
2.00.00 2016-10-16 Major upgrade of type hierarchy
1.03.01 2016-05-28 Min and max functions added for scalars
1.03.00 2016-04-23 Abs and Rel for detailed versions removed
1.02.06 2015-12-23 Dependency on reflections package removed
1.02.05 2015-12-22 ZERO constants for scalars

Release 3.01.04 – 2019-04-22

Type Changes By
Update The XSD generator now also generates unit patterns. The abbreviation itself has been removed from the human readable XML-patterns, as it can be a symbol such as the degree symbol. averbraeck
Add Several extra unit tests added for Direction, testing the valueOf() method. averbraeck

Release 3.01.03 – 2019-04-21

Type Changes By
Update The human readable form of the DirectionUnit has been improved. The old form was e.g. East(deg) which is not logical, as the unit is degree, w.r.t. the East. Therefore, the units have been changed to:
DirectionUnit.rad(North) = rad(N) | rad(North) | rad(N) | rad(North)
DirectionUnit.rad(East) = rad | rad(East) | rad | rad(E) | rad(East)
DirectionUnit.deg(North) = \U00B0(N) | deg(North) | deg(N) | deg(North)
DirectionUnit.deg(East) = \U00B0 | deg(East) | deg | deg(E) | deg(East) 
averbraeck
Update The GenerateXSD program in the djunits-generator project now also generates unit dependent XML that can only have positive values or zero. averbraeck
Update The GenerateXSD program in the djunits-generator project now also generates the possibility to use the E-notation, e.g. "1.0E+6 meter". averbraeck

Release 3.01.02 – 2019-04-01

Type Changes By
Fix The DirectionUnit gave wrong results for Northing versus Easting. Easting has now been taken as the BASE direction whereas Northing shows a shift of 90 degrees. All units are counter-clockwise. A DirectionTest and DirectionUnitTest have been added to check the correctness. averbraeck
Fix Several classes were not serializable. A unit test now checks all (outer) classes that are not interfaces, abstract classes, or classes with a private constructor (utility classes) for the implementation of the Serializable interface. Classes that were not serializable have been adapted. averbraeck

Release 3.01.01 – 2019-03-16

Type Changes By
Fix The Scalar.stringOf methods now have a space between the number and the unit, so "2.3 rad" instead of "2.3rad". averbraeck

Release 3.01.00 – 2019-03-02

Type Changes By
Fix The surefire test plugin in the pom file has forkMode set to 'always' to ensure every unit test is run as a separate process to avoid static leaks between tests. If not, the created '7abbr' units will leak from one test to the other. averbraeck
Fix The use of localizations has been fixed, and unit tests to check the localization have been included. averbraeck
Add In the djunits-generator project, the class GenerateXSD generates a file called 'djunits.xsd' with all units in /generated-code/resources, which can be used for text-based XML parsing of units. averbraeck
Update Website information has incorporated the Unit constructor changes. averbraeck
Add The properties file for the localizations file has changed. The abbreviation key now finds both the abbreviation and the name for a localized unit. In addition, zero or more text-only representations of the unit can be added in the properties file. An example: rather than having a mu-sign in the textual representations for a micrometer, a "mum" text-only version is added. Another example: the textual representation for a week can be "wk" or "week". This is especially useful in the parsing of human input or XML/JSON files. averbraeck
Add In order to guarantee one textual representation of a unit that is not localized in e.g., an XML or JSON file, extra methods have been added to the Unit class to get the abbreviation, name, and textual representations in the default locale (currently 'en'). averbraeck
Remove Since the nameKey is not used anymore to get the localized names from the properties files, the nameKey has been removed from all unit implementations. Of course it is still possible to initialize a Unit with a user-defined name. In order to make the construction easier, different constructors for user-defined and standard units are included; one with a name and an abbreviation, the other just with an abbreviationKey. The boolean to indicate whether the unit is a standard unit disappeared as a result. This influences the construction of all units! averbraeck

Release 3.00.09 – 2019-02-27

Type Changes By
Add Scalar has been provided with a stringOf(Scalar) method, and all absolute and relative scalars have been provided with a valueOf(String) method. averbraeck
Add The generators have been adapted to create the valueOf(...) code for all absolute and relative scalar classes, both Double and Float. averbraeck
Add A small demo for valueOf and stringOf has called Parsing has been added to djunits-demo. averbraeck

Release 3.00.08 – 2019-01-17

Type Changes By
Add The ParamComments utility class has been added to the djunits-generator project. It adds or updates the type for each parameter in the javadoc of all java files in /src/main/java in all or in selected projects in the workspace. averbraeck
Update Copyright message changed to 2019. averbraeck

Release 3.00.07 – 2018-08-11

Type Changes By
Add All scalars, vectors and matrices now have a setDisplayUnit method. The unit is just for display purposes; it used to be final, although the value is stored in the SI or standard unit. When a value was instantiated using an SI value, but the display unit had to be different, methods like:
   FloatDensity fd = new FloatDensity(FloatDensity.createSI(si).getInUnit(unit), unit);
had to be used. Now this can easily been done as follows:
   FloatDensity fd =(FloatDensity.createSI(si);
   fd.setDisplayUnit(unit);
averbraeck
Add For Scalar, FloatScalar, Vector, FloatVector, Matrix, and FloatMatrix, a generic instantiate method is added to a utility class (e.g., DoubleScalarUtil), which instantiates values based on the unit type it is provided with. So you can use:
  Acceleration = DoubleScalarUtil.instantiate(12960.0, AccelerationUnit.KM_PER_HOUR_2);
but also with a more 'anonymous' unit:
  Unit unitUSDm2 = new MoneyPerAreaUnit(MoneyUnit.USD, AreaUnit.SQUARE_METER, "USD/m2", "$/m2");
  MoneyPerArea moneyPerArea = DoubleScalarUtil.instantiateAnonymous(10.0, unitUSDm2);
This can be especially useful in data driven simulations where various types of data can be sent through messages, and where the message contains the unit as well.
averbraeck

Release 3.00.06 – 2018-08-10

Type Changes By
Update hashCode and equal for the MoneyUnit added. equalsIgnoreNaming(...) works on the basis of the numeric code of the currency. averbraeck

Release 3.00.05 – 2018-08-10

Type Changes By
Update hashCode and equal for the units worked only on the basis of abbreviations and names. For LinearUnit and AbsoluteLinearUnit, the scale has been added to hashCode and equals. averbraeck
Add for equals() a unit with Dutch names is different from the same unit with English names. Now, the units that have the same 'scale factor' and/or offset, have the same equalsIgnoreNaming(). This means, for instance, that although a METRIC_TON and a MEGAGRAM are different MassUnits, equalsIgnoreNaming() will now state that they are the same, as each represents 1000 kg. This also means that hand-made units that correspond numerically to an existing unit, will be considered equal according to equalsIgnoreNaming (but not to the equals method). averbraeck

Release 3.00.04 – 2018-08-09

Type Changes By
Add Matrix and FloatMatrix interface now have the get(r, c) function that was already implemented. averbraeck

Release 3.00.03 – 2018-01-28

Type Changes By
Add Typed Scalar[] toArray() function added for all vectors. averbraeck
Add VectorToArrayExample added to djunits-demo. averbraeck

Release 3.00.02 – 2018-01-28

Type Changes By
Add Iterator added to Vector and FloatVector, so statements like "for (Speed s : speedVector)" are possible. averbraeck
Fix Bug for instantiateMD() and instantiate() on the basis of a sparse Map in FloatVector solved:
  IntStream.range(0, values.size()).parallel().forEach(index -> valuesSI[index] 
    = values.get(indices[index]).getSI());
instead of
  values.keySet().parallelStream().forEach(index -> valuesSI[index] 
    = values.get(index).getSI());
averbraeck
Add VectorIteratorExample added to djunits-demo. averbraeck
Update Copyright statement extended to 2018. averbraeck

Release 3.00.01 – 2017-04-29

Type Changes By
Add For DirectionUnit, EAST_RADIAN and EAST_DEGREE have been added. averbraeck
Add For TimeUnit, several BASE units with e.g., SECOND, MINUTE, HOUR, DAY, WEEK have been added. averbraeck
Update In the TimeUnit, Time, and FloatTime classes a warning has been placed that indicates that precision is limited. For floatTime it states: Note that when the offset of a stored absolute Time becomes large, precision of a float might not be enough for the required resolution of a Time. A float has around 7 significant digits (23 bit mantissa). This means that when we need to have a float time that is precise to microseconds, the Time value should not go above 2^22 = 4.0E6. This is not enough to store Epoch values that are in the order of magnitude of 2E12 ms! So feeding System.TimeInMillis() to a FloatTime with TimeUnit.BASE as its unit is not having the required precision. At best, a FloatTime can store TimeUnit.BASE or TimeUnit.EPOCH values with real calendar values with a precision of several minutes. averbraeck
Add The GenerateUNITs has a replacement option that can insert the above precision warnings in the automatically generated Time and FloatTime (and other) classes. averbraeck

Release 3.00.00 – 2017-04-27

Type Changes By
Add Abolute units and relative units have been separated. They are truly different. In DJUNITS version 2, absolute and separate variables use the same unit. E.g., a Time and a Duration both use a TimeUnit. In classes that have to enforce that all components are of unit TimeUnit, Duration as well as Time can be used. This is not desirable. Therefore we need to split the TimeUnit, AngleUnit, LengthUnit and TemperatureUnit into an absolute and a relative version. averbraeck
Update UNITS.java has been made consistent with the absolute/relative unit changes. averbraeck
Update Unit tests have been made consistent with the absolute/relative unit changes. averbraeck
Update Documentation has been made consistent with the absolute/relative unit changes. averbraeck
Update OffsetLinearScale now extends LinearScale. averbraeck
Update MoneyPerTimeUnit renamed to MoneyPerDurationUnit; same for all other types refering to MoneyPerTime. averbraeck
Update Removed the methods to multiply and divide absolute values with absolute values. How can I multiply a position on this planet with another position on the planet? Or a time with another time? Just doesn't make sense, so removed the methods and the corresponding tests. averbraeck
Update the toAbs() and toRel() methods are removed. I don't understand how to translate 1-4-2017 at 12:00 to a relative value. The only thing that makes sense is to subtract a value (some kind of offset) from the absolute value to get a relative value. averbraeck

Release 2.02.00 – 2017-04-17

Type Changes By
Add For many Unit classes, standard units have been added to make the unit list more internally consistent. averbraeck
Update UNITS.java has been made consistent with the added units. averbraeck
Add The UNITS.java content can be generate with the GenerateStaticUNITS program in djunits-generator. averbraeck

Release 2.01.03 – 2017-01-30

Type Changes By
Update Scalars with the exception of Money scalars can now be created with e.g., Length len = Length.createSI(5.0). OTS-297. averbraeck
Update Constants NaN, POSITIVI_INFINITY, NEGATIVE_INFINITY, POS_MAXVALUE and NEG_MAXVALUE have been added to scalars, with the exception of Money scalars. OTS-298. averbraeck

Release 2.01.02 – 2017-01-24

Type Changes By
Update hashCode of Units are cached, as these are calculated in every compare of scalars. OTS-289. averbraeck
Update AbstractDoubleScalar.compareTo and AbstractFloatScalar.compareTo should use static compare method. OTS-290. averbraeck
Add Add eq0, ne0, gt0, lt0, ge0, and le0 methods to DoubleScalars and FloatScalars. OTS-293. averbraeck

Release 2.01.01 – 2016-11-14

Type Changes By
Add A neg() function has been added to the Scalar, MutableVector and MutableMatrix classes. The neg functions changes the value(s) to minus the value(s). OTS-216. averbraeck
Update Code has been cleaned for @Override and open warnings for formatting of comments. averbraeck

Release 2.01.00 – 2016-11-01

Type Changes By
Update Several changes have been made to increase the speed of instantiation of scalars. Especially the need to use espessAsUnit(...) when the unit is the SI-unit has been decreased. This leads to a major speed improvement of the use of scalars. averbraeck
Update A start has been made to increase the speed of instantiation of vectors. Further speed improvements will be made in the next version. averbraeck
Add The Unit has a new method 'boolean isBaseSIUnit()' to help determine the need for conversion of a value into a standard (usually SI) unit. averbraeck
Add The Scale has a new method 'boolean isBaseSIScale()' to help determine the need for conversion of a value into a standard (usually SI) unit. averbraeck

Release 2.00.00 – 2016-10-16

Type Changes By
Update A major upgrade has been made to the type hierarchy. Instead of the TypedXXX template functions, abstract classes and interfaces have been introduced that are more natural to implement and have faster execution than the typed templates. averbraeck
Update The DoubleScalar, DoubleVector, DoubleMatrix classes are not at the root of the typed classes anymore. Rather, they are an implementation of the Abstract classes, next to the typed classes in the type hierarchy. So a Length does not extend a DoubleScalar.Rel anymore. Rather, Length and DoubleScalar.Rel both extend AbstractDoubleScalarRel. Same for the Float classes. averbraeck

Release 1.03.01 – 2016-05-28

Type Changes By
Add min and max functions have been added for scalars, for combinations of abs, rel, dimensionless, money, and float. averbraeck
Update Copyright notice has been extended to 2016. averbraeck

Release 1.03.00 – 2016-04-23

Type Changes By
Update The following changes have been made: Time.Abs, Time.Rel --) Time, Duration (TimeUnit) Length.Abs, Length.Rel --) Position, Length (LengthUnit) Temperature.Abs, Temperature.Rel --) AbsoluteTemperature, Temperature (TemperatureUnit) Angle.Abs, Angle.Rel --) Direction, Angle (AngleUnit) averbraeck

Release 1.02.06 – 2015-12-23

Type Changes By
Update DJUNITS is no longer dependent on 'reflections'. Instead, the 'Unit' class now defines an array of standard units that exist in the package. This list is also used in the unit tests (it is public static final). averbraeck

Release 1.02.05 – 2015-12-22

Type Changes By
Add Added ZERO constants for double and float scalars, with the exception of Money scalars. averbraeck