Can you really put an algorithm section inside an equation section?
Yes, you didn't think so, did you?
Create the class, Average, which calculates the average between two named integer parameters, using an algorithm section.
Create another class and declare an instance of the Average class using modifiers to change the parameter values.
Simulate and then test the result of the instance class by using the val function to look at the values:
Write a class, AverageExtended, that calculates the average of 4 variables (a, b, c and d).
Create another class and declare an instance of the AverageExtended class using modifiers to change the parameter values.
Simulate and then test the result of the instance by using the val function to look at the values at time=0..
Note that the sum is calculated in an equation section to show that it is possible to mix algorithm and equation sections in a class.
Then you can look at the values of the variables at a specific point in time by using the val function. We choose time = 0 below.