ReleaseNotes:Planimate 5.01 Release Notes

From Planimate Knowledge Base
Jump to: navigation, search

5.01i


SPEED Optimisations assuming PL is running in an environment with VM FEC event processing streamlined Old track object unblocking code cleared out Track loops cache information to avoid having to look up/test use of gates and exit conditions Some debug options removed (from release builds) Time-profiling-enabled check code sped up Object input pruning rewritten to avoid unneeded memory reallocation Object input/output links now cache object instance pointers Sped up destination object/flow search preferred links only format names if they have an error to report routes now use preallocated tables (limit of 256 steps per route) Added routeinstance cache so route info doesn't get reallocated sped up FEC event cache; no longer impose cache size limit inlined switch decision reset list
Planimate table sorts are now more efficient; use preallocated index tracking tables (if the table is < 50000 rows) and validation of the sort is more efficient.
The item recycler now sniffs around a bit for an item with the same class as the new one being allocated. This can avoid reallocating item attributes/item tables.
NEW Find (Advanced) for a specific attribute reference.
You can also use "wildcards" by using the system->null attribute as a field placeholder which will then match any constant/item/etc in that field of the attref.

5.01h


CHANGE: The "end time" for a run is now taken as the time that the engine finished processing events, not the time the run is stopped. this makes profiling much easier.

5.01g


BUGFIX Crash in F (broken table code)

5.01f


BUGFIX Distribution patterns used in routines that executed in lookahead did not properly "undo" possibly leading to lookahead and move not matching (if the random variable was depended upon in a blocking switch)
SPEED Reduced memory allocation "thrashing" when splitters are used with different outgoing item classes to the incoming item and there are NO common item attributes to "tuple"
SPEED Reduced memory allocation "thrashing" when table tupling is used and there are no matching attributes (don't know why it would be used... but its fixed anyway)
SPEED Optimisation where a routine has the "Only During Move" routine line as the first routine line - now processes as quick as using the "Only During Move" routine option.
(the line is used instead of the option when the modeller wants code "only during move" not to mark the thread as "dirty", preventing decisions based on attributes further down that thread).
SPEED (possibly) optimised the way internal tables are searched
SPEED Built with VC and set "inline all possible functions" flag

5.01e


BUGFIX Hidden objects not selectable in drag
NEW ctrl-click table button in attref dialog shows the table editor for that table
NEW New format modes for Percentage (x.xx) without % and Parts Per Million without the "ppm"
NEW Second column title text of table can be set in a routine
NEW "FIND" ability for label references with no label for the index/value (in the Edit->Find->Advanced button list)
This will search the model for any constant label references that do not map to a label string. It shows the attribute reference browser to assist in browser though sometimes the bad reference can be very deep (eg: within a scalar for a field inside a distribution pattern dialog).
Note: references with a value of "0" are not treated as "Bad" even if a label for 0 does not exist.
NEW When an attribute reference listed in a references list is double clicked, if the reference is in a routine then the routine object will flash then the routine editor will be opened.

5.01d


BUGFIX Buffer overflow if labels > 64 characters used in many places such as graphs, attribute value/clear value etc.
CHANGE Made fact that row count set to 0 in a gantt uses row labels more obvious in dialog and status menu
CHANGE The Label List selection list is now substantially bigger
NEW Model DB can contain help (CHM) files, PL will look in there as well when trying to locate a help file
NEW Modeller specified model help file name and standalone EXE support
InterDyne settings has a new field for help file name. This sets the application (modeller supplied) help file, overriding the default use of the model's name if this field is empty.
The extention (".CHM") is optional; PL will strip any extention and add ".CHM" to whatever name is supplied.
PL will look in DB files to locate this help file.
If a modeller wants to ship a standalone EXE with a help file inside it, import the CHM file into the model's DB file (Tools -> Resource File Admin) before creating the standalone EXE. Planimate will then unpack the CHM file into the PL_MEDIA subdirectory when the user first accesses it.
NEW System attribute returns windows multimedia timer. The value is in milliseconds with 1 ms accuracy, useful for profiling.
Note this value wraps to 0 when it reaches 2^32 (about every 50 days
NEW Units format "ppm" (parts per million)
1000000ppm = 1 unit. One decimal digit is allowed.
NEW Run profile logging for: Routines Invoked By Track Lookahead gives routines invoked in track testenter OR track checknext Routines Invoked By Track CheckNext Only gives routines invoked in track checknext (far lookahead) only Routines Invoked By Track Loops in/out routines as trains move (never done in lookahead) Blocking Switch Decision In Lookahead blocking switches that had to make decisions (lookahead)
NEW Paint image select file dialog now shows all supported image types by default
NEW Clicking on a multiserver icon (or its head in "road" mode) during run (not user mode) enables you to browse its items, showing item entry time, class, id and time-till-departure. Clicking on a line will show the item details for that item.

5.01c


BUGFIX Leak in jpg/gif/... code fixed
NEW New system attribute (Engine) "Automatic Restart After Error" [Experimental]
If the model sets this attribute to 1 during a run AND the "Restart When Model Stops" option is enabled, then PL will attempt to restart the model if a model error occurs.
This is intended for special cases where model errors in some runs are unavoidable (eg: a modeller managing multiple runs of a network directly rather than using PL's inbuilt mechanism).
It is not to be used for general modelling or catching file errors. It will not work if the "Friendly Errors" dialog is enabled or any other dialog appears, apart from the standard "model error" dialog appears.
When an error occurs, the model error dialog appears for 10 seconds. If the user clicks/closes the dialog then the restart will not occur, otherwise the dialog closes and the model restarts.
The modeller should check and act on the "last stop reason" system attribute (if they are relying on restarts a handler for this should already be there).
Upon a restart this attribute gets reset to 0. The modeller should only set it non zero after the code that proceeds it has been proven robust.
BUGFIX After a dataset is loaded and its broadcast is sent, any other current time events (created eg: because switches depend on the data loaded) are now cleared before returning to the user.
BUGFIX Copying a subsystem with paint objects and table references to them The copied tables will now point to the copied paint objects
CHANGE Internal change to broadcasts to avoid recursion of Continue() form within a broadcast handler if the system was in simulate mode when the broadcast was sent (eg: loading a dataset in a routine).

CHANGE Internal change: subsystem knows owner is only a portal

5.01b


NEW Support for JPG/GIF/WMF/EMF (windows metafiles) in paint image objects.
These are rendered straight from the file to the display (so huge files should be OK and wont need the memory of an equivalent BMP)
Currently not supported for icons/paint button states (these use memory cached BMPs)
Not supporting animated images
CHANGE Importing into DB file : no longer need to specify "type" if the extention is recognised by the DB system
CHANGE exporting from DB - sets file extention form its type
CHANGE selecting files from DB reworked to retain original extention of the file so it can be correctly reloaded
CHANGE New percentage mode is now x.xxx%
NEW New system attribute (Engine) gives access to option whether "Animation Starting" messages will be presented to the user.

5.01a


NEW Pipes have a new option to send a broadcast when a pipe event occurs.
Pipes with this selected will send the new "_Pipe Event" broadcast as a global broadcast.
It will tuple match to the following item attributes:
_pipeid : the pipe object index (or 0 if no index set) _pipeflags" : a value as folows:
1: Pipe destination is at target limit
This indicates the destination of the pipe has become very close or >= than the pipe's "target limit" (meaning within 1.0e-12 of it).
If the modeller takes action on this broadcast, they must realise that in some unlikely circumstances, the target attribute may be short by up to 1.0e-12 of the intended limit.
The broadcast is sent every pipe update iteration once the target limit is reached, hence the modeller should stop the pipe and/or clear the target within that broadcast thread to avoid getting stormed with broadcasts.

NEW Pipe option "Adjust Update Interval To Reduce Errors"
BACKGROUND
Pipes move values from one place to another by generating events at regular intervals and subtracting/adding to the source/target according to a specified hourly rate.
Numbers in PL are represented using C double precision values (64 bit). These have a precision of about 14 decimal digits. This precision limit becomes a problem when the pipe is transferring in small amounts to end points which contain a large value.
For example a pipe may be set up to transfer at a rate of 1750 units per hour, at a sampling resolution of 10 seconds to a target already containing 2 billion units.
1750 / 3600 * 10 = 4.86111111111111 (the number recurs but in memory would stop after 14 digits or so)
When the pipe dumps the first quantity into the target it does:


2,000,000,000 . 000 000 000 000 00 + 4 . 861 111 111 111 11 ^
but due to the 14 digit limit, the result will lose the smaller fractions of the value being added because its a large value and runs out of precision (about where the ^ is)
Over time these errors accumulate, leading to noticeable misbalance in the system and comparisons against expected limits failing.
Ways to alleviate this problem include:

  • keep sources and targets as small as possible (eg:have a separate accumulator for your "entire" stockpile)
  • dont sample more often than necessary (the more frequently it samples, the smaller the values moved)
  • dont code/expect exact quantities with pipes, allow a margin of error either way

An additional and significant improvement can be gained using this new option.
WHAT THE NEW OPTION DOES
Given that the hourly rate for the pipe is known, PL adjusts the transfer amount per sample to a value which takes less precision to represent. To compensate for this, the update interval is adjusted slightly, in order to keep the hourly rate the same.
So basically it trades off accuracy in the amount transferred against the accuracy of the sampling interval.
This all assumes that a "real world" model does not get troubled by the sampling interval not being exact.
EXAMPLE
In the case above, the amount per sample becomes 4.859375 (looks strange because truncation is done in base-2 math) and the sampling interval becomes 9.996428571429 (expect up to 0.1% variation from what is specified)
Test case:
Set up to transfer 100 million units to a destination containing 2 billion, at rate and sampling as specified above.
With this option off, you end up with surplus of 1.124 units. This would cause matching problems if you were testing the result against a hard-coded number, mess up material balances etc.
With this option on, the values are accurate to the display resolution.
NOTE:
The precision limits are still there and will still manifest themselves when the ratio of bin level to transfer amount per sample is high.
Initial testing suggests a ratio of 100 million to 1 should be OK
NEW Clicking on a pipe in paused mode displays useful information in high precision, including its transfer rate per sample and update interval.
CHANGE "Animation Starting" and a couple of other dialogs are redone so the buttons can be customised with labels more specific than "OK" and "Cancel" (all the system dialog provided).
BUGFIX Fixed crash bug when cell stats point beyond a table's columns at run start (because the table shrunk during the run)
NEW Value format: Percentage XX.XXX always displays at least 2 leading zeros and 3 decimal places
NEW Spatial links have option to hide them individually. They are hidden in end user and run mode but will always be visible in edit mode.

5.01


NEW Attrefs have a new mode "Expression" where an expression can be directly typed in.
Expressions follow BODMAS rules so a*b+c*d will evaluate as (a*b)+(c*d). Unneeded brackets are removed.
Expressions can include constant values, attribute references and some basic math functions.
Expressions can include:
+, -, *, / and ( )
the following single value "functions" are currently available:
sqrt(x) square root sqr(x) square (x * x) fabs() removes the sign of x so its always positive round(x) rounds x to closest integer trunc(x) removes fraction of x, leaving just integer part ceil(x) lowest integer which is >= x floor(x) highest integer which is <= x exp(x) e to the power of x ln(x) natural log of x log10(x) base 10 log of x pow10(x) 10 to the power of x pow2(x) 2 to the power of x
cos(x) sin(x) trig functions, x in radians tan(x)
acos(x) asin(x) arc-trig functions, return radians atan(x)
Attribute references:
Currently expressions can include attribute references as follows
i.attname : item attribute p.attname : portal attribute r.attname : routine attribute s.attname : system attribute
If "attname" contains spaces or non alphabetic/numeric symbols, it must be quoted:
examples:
p.attribute i."next location" s.clock s."run number"

Expressions are "parsed" when OK is entered so any syntax errors will be picked up during editing. Run time speed should be faster than the equivalent code using multiple routine lines.
Attribute names are not validated until run time.
FIX: Browsing then cancelling a paint button state image file gives the option to remove the currently associated image (if any).
BUGFIX: Drags of viewports in user mode - stopped no longer possible


idkbase note 315