Release 3, Sprint 45

Responding to several user requests, we have added comprehensive support for String States as well as several new numeric state types. We have also enhanced Vehicle behavior to address a common modeling need. And we have added new capability to Repeat groups that will be particularly useful for people building custom hierarchical objects.

States Ribbon

We’ve added several categories of states to the Discrete group, including Integer, Boolean, DateTime and String. The Real, Integer, Boolean and DateTime states can be scalar (default), vector or matrix type states. The String state is scalar. All discrete-change states can be changed by assignment logic at discrete times during a model run.

String Functions

Based on the new String States that have been added, there are also a number of string functions that may be used, including:

  • String.Length(string) – returns the length of a string
  • String.Contains(string, substring) – return true if substring is in string, otherwise false
  • String.Substring(string, startindex, length) – returns a substring of string starting at startindex and of the specified length
  • String.FromReal(value) – returns a string representation of a real value (String.FromReal(6) turns into “6”)
  • String.ToReal(string) – returns a real value representation of a string (String.ToReal(“6.2”) turns into 6.2)
  • String.FromDateTime(value) – returns a string representation of a datetime value based on the start date and time of the simulation (String.FromDateTime(6) turns into “October 1, 2010 06:00:00” if the start date of the simulation is “October 1, 2010 00:00:00” )
  • String.ToDateTime(string) – returns a datetime representation, in hours, of a string based on the start date and time of the simulation model (String.ToDateTime(“October 11, 2010”) turns into 0 if that is the start date of the simulation, 24 if the start date is October 10, -24 if the start date is October 12, etc.)
  • String.Format(string, arg1, arg2, …) - returns a new string formatted with the specified format string and arguments. We follow the .NET string formatting syntax here: String.Format(“Hello {0}, you are {1} years old”, “Friend”, 30) turns into “Hello Friend, you are 30 years old”
  • String.Compare(string1, string2) – returns 0 if the strings are equal, -1 if string1 < string2, 1 if string1 > string2
  • String.CompareIgnoreCase(string1, string2) – same as above, but ignores casing in comparison, so String.Compare(“fred”, “FRED”) does not return 0, but String.CompareIgnoreCase(“fred”, “FRED”) does return 0.
  • Strings in Expressions – Simio supports ‘+’ for strings such that “Hello” + “ World” turns into “Hello World”. We also support the logical comparison operators, such as ‘==’ or ‘>’. You can now use ‘MyStringstate==”Red”’ or ‘MyStringState > “A”’ in an expression

Vehicle and Worker Behavior

We’ve changed the Vehicle and Worker object behavior for accepting entity reservations based on many customer needs. A Vehicle or Worker with Ride Capacity > 1 will now accept multiple reservation requests if all of those requests are originating from the same pickup location. For example, suppose a Vehicle with Ride Capacity = 3 accepts a request to pick up a rider at Node A. While traveling to Node A, that Vehicle will also accept up to 2 more pickup reservation requests (up to its ride capacity) if those requests are also originating from Node A where the vehicle is already headed to do a pickup. Previously, the Vehicle would not accept any more pickup reservation requests after the first one.

Property Repeat Groups

We’ve enhanced our property repeat group capability by adding the ability to reference repeat groups and their properties similar to referencing tables. This feature should be very beneficial in object building.

For example, let’s say you have a repeat group named MyRepeatGroup with two properties within the repeat group, MyTime and MyEntityReference. You may now utilize the SetTable step with the Table Name set as ‘MyRepeatGroup’. You may also utilize other table functions, as shown below, in expressions.

  • Use “MyRepeatGroup.MyTime”
  • Use “MyRepeatGroup[x].MyTime”
  • Use “MyRepeatGroup.MyTime.RandomRow”
  • Use “MyRepeatGroup.AvailableRowCount”
  • Use “MyRepeatGroup.MyEntityReference”, as a reference property in places that take an entity reference

You can now specify a table name in a repeat group property. If a repeat group references a table, then when asking for the number of rows in the repeat group (either for traversing the repeat group in a step, or asking for it in an expression, such as “MyRepeatGroup.AvailableRowCount”), the number of rows of the table will be returned. Additionally, when the engine traverses each tuple in the repeat group, it will implicitly map to a set table reference to the corresponding row in the table. Therefore, any table reference properties in the single repeat group referencing tuple, such as “MyTable.Property”, will resolve correctly.