Eclipse CD5405 Manuel d'utilisateur Page 9

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 23
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 8
This output shows each step being assigned to an agent and the agent starting that step. If
the step is a leaf, we see the agent completing the step. If the step is a sequential step, it
automatically completes when its last substep completes. The “at” numbers identify the
time on the simulation timeline at which these activities took place.
7. Data flow
Steps and substeps can pass data between each other. Specifically, a step passes data to
its substeps when the substep is posted. The substep passes output back to its parent
when the substep completes. To get this to happen in Little-JIL, you need to do several
things:
Define the Java class that is the data’s type.
Declare a parameter on the steps that use that data.
Bind parameters in the parent to parameters in the substep. (In text-based languages,
this binding is inferred from the order of parameters in the method call and method
declaration. In Little-JIL, the calls are not explicit and so the bindings must be explicit.)
Declaring the Java types. Switch to the Java perspective. Open the File menu, select
New and then Source Folder. Name the Source Folder src. Next, create a new package by
clicking on the package icon in the toolbar:
Set the Source folder to StreamDischarge/src and the name to streamDischarge.
Next, we will create a class. Click on the icon in the top toolbar that is a C in a green circle.
Make sure the source folder is StreamDischarge/src and the package is streamDischarge.
Enter SensorData for the name and click Finish. This will create the stub for a new class
named SensorData.
Define the SensorData class like this:
package streamDischarge;
import java.io.Serializable;
public class SensorData implements Serializable{
! private static final long serialVersionUID = 1L;
}
Create a second class similarly defined named DischargeData.
Declaraing the parameters. Select the Read S step. In the Interfaces view, pull down
the Add menu and select Parameter. Set the Declaration Type to Out. Use s for the
parameter name and streamDischarge.SensorData for the parameter type.
On the Adjust S step, add an in/out parameter named s whose type is streamDischarge.
SensorData.
Vue de la page 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 22 23

Commentaires sur ces manuels

Pas de commentaire