Changes Report

Release History

Version Date Description
4.01.01 2019-10-31 SpotBus instead of FindBugs in Maven
4.01.00 2019-10-25 Code generation for new units; BaseUnit renamed to Quantity
4.00.04 2019-10-20 Standard units for new additions added
4.00.03 2019-10-19 Per-units updated to reflect correct name and abbreviation
4.00.02 2019-10-19 Small updates in site docs, javadoc, final
4.00.01 2019-10-18 MAJOR NEW RELEASE, MANY METHODS CHANGED
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 4.01.01 – 2019-10-31

Type Changes By
Fix Ensured that "package-list" exists in apidocs for backward compatibility of javadoc linking. averbraeck
Update Fixed TODO regarding memory use for temporary matrix to convert the values to SI. pknoppers
Fix Replaced FindBugs (which already had a problem supporting Java 8) with SpotBugs (supporting later Java versions as well). averbraeck
Update Updated JavaParser to latest version in djunits-generator to be compatible with Java 11+. averbraeck
Update Included jakarta.annotation-api to be compatible with Java 11+. averbraeck
Fix tt-tag in javadoc replaced by code-tag to be compatible with HTML-5 and Java-11+. averbraeck
Fix javadoc source version 8 added to pom-file to be compatible with Java-11+. averbraeck

Release 4.01.00 – 2019-10-25

Type Changes By
Update Renamed UnitBase to Quantity (which should be more descriptive); UnitTypes renamed to Quantities. pknoppers
Add Added quantity name field to UnitBase. pknoppers
Fix UNITS.java has been regenerated including the new units. averbraeck
Add UnitTypes.getRegistry() method added. averbraeck
Fix Unit.getAbbreviations() now returns a safe copy. averbraeck

Release 4.00.04 – 2019-10-20

Type Changes By
Add Standard units such as the rad, rem, Gauss, Maxwell and others added for: AbsorbedDose, AmountOfSubstance, CatalyticActivity, ElectricalCapacitance, ElectricalConductance, ElectricalInductance, EquivalentDose, Illuminance, LuminousFlux, LuminousIntensity, MagneticFluxDensity, MagneticFlux, and RadioActivity. averbraeck
Add DoubleScalars and FloatScalars again extend Number to be able to seamlessly exchange Double, Float, Long, Duration and Time for simulation times and durations in DSOL. averbraeck

Release 4.00.03 – 2019-10-19

Type Changes By
Fix The "per" units such as FrequencyUnit (per second) and LinearDensityUnit (per meter) were receiving incorrect names ("nano per second" instead of "per nanosecond"), abbreviations (n/s instead of /ns) and scales (per millisecond was scaled as 1.0E-3 per-second instead of 1.0E3 per-second). The "PER_UNIT" has been added to the SIPrefixes, and a method derivePerSI(...) has been added to Unit to take care of proper generation of "per" units. averbraeck
Fix The derived units of a higher power such as AreaUnit (square second) and VolumeUnit (cubic meter) were receiving incorrect names ("kilosquared meter" instead of "squared kilometer"), and scale factors (1000 for square kilometer instead of 1E6). This has been repaired by introducing a power factor in all derived units using an SI prefix. This unit can, of course, be 1.0. averbraeck

Release 4.00.02 – 2019-10-19

Type Changes By
Fix Tested and repaired the determinant() function of the FloatMatrix and DoubleMatrix. averbraeck
Update Site documentation adapted for version 4. averbraeck
Fix Javadoc fixed in a couple of places to account for generics parameters. averbraeck
Fix Added 'final' for parameters in a number of methods. averbraeck

Release 4.00.01 – 2019-10-18

Type Changes By
Add Added SIDimensions class to indicate the factors used in each unit (m/s2 = m1 s-2 kg0 mol0 rad0 sr0 A0 cd0 K0). The SIDimensions class is used to construct new SIUnits and to do dimension checks. averbraeck
Add Every unit now has a BaseUnit that stores the common dimensionality of all the DisplayUnits of that unit. averbraeck
Add The following units have been added as standard units w.r.t. djunits version 3: AbsorbedDose, AmountOfSubstance, CatalyticActivity, ElectricalCapacitance, ElectricalConductance, ElectricalInductance, EquivalentDose, Illuminance, LuminousFlux, LuminousIntensity, MagneticFluxDensity, MagneticFlux, and RadioActivity. averbraeck
Update All classes with the name AngleSolid have been renamed to SolidAngle. averbraeck
Update Package structure for each type of scalar, vector and matrix updated to have the types (including SI type), the base (abstract) classes from which the types extend, and the data classes that are used to store the data internally. averbraeck
Update The absolute and relative classes have new abstract classes that are organized as follows: Rel, Abs, and RelWithAbs. The latter is there to allow Abs = Rel.plus(Abs) operations. averbraeck
Add Almost full coverage of unit tests made to catch many errors. pknoppers
Fix Fixed dozens of errors in (sparse) vector and matrix calculations. pknoppers
Update Changed the vector and matrix calculation routines for sparse and dense data in such a way that the assign(Function) method is used to do the majority of calculations, avoiding many different implementations for operation on (especially sparse) vectors and matrices. pknoppers
Remove Several operations have been removed that do not make sense, such as multiplying or dividing absolute values with each other (or with relative values). This does not make sense as they do have a scale with a shifted (or fixed) offset. averbraeck
Remove The separate mutable types of Vector, Matrix, FloatVector and FloatMatrix have been removed. Instead, a flag in the different types indicates whether it is mutable or not. CopyOnWrite is used to avoid duplicating data when no changes are made to vectors and matrices. averbraeck
Remove For now, the Money types have been removed because they were not generic enough and did not provide enough added value. In a later version, the money types might come back in a much more flexible version (possibly as an extra SIDimension). averbraeck
Add of(value, "unit") static method added for all scalars to make it easy to instantiate a scalar. averbraeck
Add as(unitType, displayUnit) and asUnit() methods added for all scalars to transform an SIScalar to any type. averbraeck
Update create(...) methods renamed to instantiate(...) methods. createSI(value) in scalar is now instantiateSI(value) to make it consistent with matrices and vectors. create() methods in SIScalar, SIVector, SIScalar renamed to instantiate(). instantiate methods for scalars are now all instantiateSI methods to make it consistent with the SI values in the data storage of matrices and vectors. Added instantiate methods in all classes to deal with user-defined units, scalars, vectors and matrices. Changed getUnit() to getDisplayUnit() for all values. Repaired imports for new locations of classes. Changed the SI classes to use instantiate(...) instead of create(...). averbraeck
Update ojalgo and joda-money have been updated to new versions. Code has been slightly adapted to handle new matrix handling algorithms in ojalgo. averbraeck
Fix Mistake in ElectricalChargeUnit repaired: MILLIAMPERE_HOUR = new ElectricalChargeUnit(ElectricalCurrentUnit.MILLIAMPERE, DurationUnit.HOUR, "ElectricalChargeUnit.mAh", SI_DERIVED); had the same abbreviation as: MILLIAMPERE_SECOND = new ElectricalChargeUnit(ElectricalCurrentUnit.MILLIAMPERE, DurationUnit.SECOND, "ElectricalChargeUnit.mAh", SI_DERIVED); averbraeck
Add New test in UnitsTest to find errors such as the one above. All units are compared on a constructed scalar with new(...) and a scalar with valueOf(...) to see if they match. averbraeck

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