task_id large_stringlengths 7 7 | category large_stringclasses 10
values | sub_category large_stringlengths 6 61 | prompt large_stringlengths 37 366 | canonical_solution large_stringlengths 18 9.75k |
|---|---|---|---|---|
DVS_001 | FDDEVS | Basic State | Define a passive state called 'IDLE'. | passivate in IDLE! |
DVS_002 | FDDEVS | Basic State | Define a hold state called 'PROCESSING' for 5.7 time units. | hold in PROCESSING for time 5.7! |
DVS_003 | FDDEVS | Initial State | Define the initial state of the model as a passive state called 'READY'. | to start passivate in READY! |
DVS_004 | FDDEVS | Transition | Define an internal transition from state 'ACTIVE' to state 'FINISHED'. | from ACTIVE go to NEXT_STATE! |
DVS_005 | FDDEVS | Output | Configure the model to send the message 'DONE' after state 'TASK_COMPLETED'. | after TASK_COMPLETED output DONE! |
DVS_006 | FDDEVS | External Transition | Configure the model that when in state 'WAITING' and receiving the message 'START', transition to state 'RUNNING'. | when in WAITING and receive START go to RUNNING! |
DVS_007 | SES | Decomposition | Configure the model that under the 'music' perspective, 'JazzBand' is composed of: 'BandLeader', 'RhythmSection', 'HornSection', and 'ReedSection'. | From the music perspective, JazzBand is made of BandLeader, RhythmSection, HornSection, and ReedSection! |
DVS_008 | SES | Coupling | Configure the model that in the 'music' perspective, the 'BandLeader' sends the message 'PlayBeat' to the 'RhythmSection'. | From the music perspective, BandLeader sends PlayBeat to RhythmSection! |
DVS_009 | SES | Hierarchical | Define that, under the 'dataGather' perspective, 'DataGatherPhase' is composed of 'getData' and 'validateData'. | From the dataGather perspective, DataGatherPhase is made of getData and validateData! |
DVS_010 | SES | External Input Coupling | Configure the model that in the 'dataGather' perspective, the parent entity 'DataGatherPhase' sends 'ClearObjectives' to the component 'getData'. | From the dataGather perspective, DataGatherPhase sends ClearObjectives to getData! |
DVS_011 | Elaboration | Data Type | Define an object 'Command' with attributes 'Mode' (String) and 'Duration' (TimeInterval). | A Command has a Mode and Duration! The range of Command’s Mode is String! The range of Command’s Duration is TimeInterval with default "new TimeInterval()"! |
DVS_012 | Elaboration | Variables | Declare the use of a variable 'count' of type 'int' with default value "0". | use count with type int and default "0"! |
DVS_013 | Elaboration | Tagged Block (Init) | Create an initialization block to set 'count' to 0 and instantiate 'wtd' as a new 'WorkToDo'. | Initialize variables <% count =0; wtd = new WorkToDo(); wtd.setId(count); wtd.setprocessingTime (20+count); %>! |
DVS_014 | Elaboration | Tagged Block (Output) | Create in the output event of state 'generate', add 'wtd' to port 'outJob'. | output event for generate <% output.add(outJob, wtd); %>! |
DVS_015 | Elaboration | Non-deterministic | Implement internal logic for state 'generate': increment 'count', and if 'count' is greater than or equal to 'numberOfJobs', transition to 'passive'; otherwise, create a new 'WorkToDo'. | Internal event for generate <% count ++; if (count>=numberOfJobs) passivateIn("passive"); else{ wtd = new WorkToDo(); wtd.setId(count); wtd.setProcessingTime(20+count); } %>! |
DVS_016 | Specialization | Taxonomy | Create the component 'getData' can be 'immediateAccess', 'findInDataBase', or 'startResearch' in the 'meansToGetData' specialization. | getData can be immediateAccess, findInDataBase, or startResearch in meansToGetData! |
DVS_017 | Specialization | Aspect Modification | Indicate that 'DataGatherPhase' can be 'Present' or 'NotPresent' in the 'presence' specialization. | DataGatherPhase can be Present or NotPresent in presence! |
DVS_018 | Specialization | Multiple Specializations | Define that 'reuseFromRepository' can be 'local' or 'internet' (location) and also 'open' or 'restricted' (accessRights). | reuseFromRepository can be local or internet in location! reuseFromRepository can be open or restricted in accessRights! |
DVS_019 | Variables | Range Constraints | Define that the height range of a 'boy' is of type double with values between 20 and 72. | The range of a boy’s height is double with values! |
DVS_020 | Specialization | Pruning Values | Assign the range for the height of a 'short_boy' and the eye color 'grey'. | Set short_boy’s height to! Set short_boy’s eyeColor to grey! |
DVS_021 | SES | Multi-Aspect | Define that, under the 'fastProcess' perspective, the system 'MSProcessSystem' is decomposed into: 'User', 'ClarifyObjectivesPhase', 'getModelFromRepository', 'ExecuteModelPhase', and 'InterpretResultsPhase'. | From the fastProcess perspective, MSProcessSystem is made of User, ClarifyObjectivesPhase, getModelFromRepository, ExecuteModelPhase, and InterpretResultsPhase! |
DVS_022 | SES | Multi-Entity | In the 'multiPerson' aspect, define that the entity 'People' is composed of more than one 'Person'. | From the multiPerson perspective, People are made of more than one Person! |
DVS_023 | SES | Uniform Coupling | Using uniform coupling, define that all 'Person' send the message 'Bye' to the instance 'id0_Person'. | From the top perspective, all Person sends Bye to id0_Person! |
DVS_024 | SES | Broadcast Coupling | In the 'top' perspective, define that all 'Person' send the message 'Hello' to all 'Person' (except themselves). | From the top perspective, all Person sends Hello to all Person! |
DVS_025 | SES | Pairwise Coupling | In the 'dating' perspective, define that each 'Boy' sends an 'Invitation' to each 'Girl'. | From the dating perspective, each Boy sends Invitation to each Girl! |
DVS_026 | SES | One-to-All | In the 'dating' perspective, define that the component 'MatchMaker' sends 'MakeInvitation' to all 'Boy'. | From the dating perspective, MatchMaker sends MakeInvitation to all Boy! |
DVS_027 | SES | All-to-One | In the 'dating' perspective, define that all 'Boy' send their 'Preference' to the 'MatchMaker'. | From the dating perspective, all Boy sends Preference to MatchMaker! |
DVS_028 | SES | Specialized Restructuring | Perform multi-aspect restructuring using the 'index' specialization and define multiplicity for 4 instances of 'MonorailStation'. | restructure multi-aspects using index! set multiplicity of index as for MonorailStation! |
DVS_029 | SES | Graph Coupling | Write a cyclic coupling specification for 'MonorailStation' based on the 'circle' graph using the 'index' specialization. | write cyclic specification for MonorailStation and index based on circle! |
DVS_030 | SES | Directed Graph Logic | For the 'circle' graph, define that the left node (leftnode) sends 'Car' to the right node (rightnode). | for circle leftnode sends Car to rightnode! |
DVS_031 | Inheritance | Instance Creation | In the 'SimpleWorkFlow' system, create two instances of 'GeneratorOfJobs' named 'First_GeneratorOfJobs' and 'Second_GeneratorOfJobs'. | From the top perspective, SimpleWorkFlow is made of First_GeneratorOfJobs, Second_GeneratorOfJobs, and ProcessorOfJobs! |
DVS_032 | Inheritance | Explicit Base | In the pruning file, specify that the generated class should directly inherit from the 'Reactive' behavior. | inherit from Reactive! |
DVS_033 | Elaboration | Method Override (Java) | Implement the method 'interpretNameAsPeriod' in Java to set the period to 50 if the name starts with "Slow" and 10 if it starts with "Fast". | private double Period; public void interpretNameAsPeriod() { if (name.startsWith("Slow")) { Period = 50; } else if (name.startsWith("Fast")) { Period = 10; } else { Period = 20; } } |
DVS_034 | Protocol | Interface Def. | Define an object 'NamedMessage' with 'myName' (String) and 'myMessage' (MessageBag). | A NamedMessage has myName and myMessage! The range of NamedMessage’s myName is String! The range of NamedMessage’s myMessage is MessageBag! |
DVS_035 | Protocol | Port Configuration | Configure the 'Simulator' to accept input on 'GetOutput' (type DoubleEnt) and produce output on 'MyOutput' (type NamedMessage). | accepts input on GetOutput with type DoubleEnt! generates output on MyOutput with type NamedMessage! |
DVS_036 | FDDEVS | Protocol Logic (Coord) | In state 'sendGetTN', the Coordinator should send 'GetTN' and transition to 'waitForAllTN'. | after sendGetTN output GetTN! from sendGetTN go to waitForAllTN! passivate in waitForAllTN! |
DVS_037 | FDDEVS | Protocol Logic (Sim) | The Simulator, upon receiving 'GetTN' in 'waitForGetTN', should transition to 'sendMyTN' and, after 0 seconds, send 'MyTN'. | when in waitForGetTN and receive GetTN go to sendMyTN! hold in sendMyTN for time 0! after sendMyTN output MyTN! |
DVS_038 | FDDEVS | P/S Router Logic | Define the initial state of the router as 'waitForInput' and the transition upon receiving a 'PublishRequest'. | to start passivate in waitForInput! when in waitForInput and receive PublishRequest go to handlePublishRequest! |
DVS_039 | FDDEVS | P/S Router Timing | Configure the processing time for 'handleSubscribeRequest' as 0.1 seconds, returning to 'waitForInput'. | hold in handleSubscribeRequest for time .1! from handleSubscribeRequest go to waitForInput! |
DVS_040 | Elaboration | Relation Declarations | Declare the use of three relations ('Relation') for the router: 'PublisherTopic', 'TopicSubscriber', and 'TopicValue'. | use PublisherTopic with type Relation and default "new Relation()"! use TopicSubscriber with type Relation and default "new Relation()"! use TopicValue with type Relation and default "new Relation()"! |
DVS_041 | Elaboration | External Event (P/S) | Implement Java logic to process a 'SubscribeRequest': extract the subscriber and topic, store them in the relation, and add dynamic coupling in the parent model. | external event for waitForInput with SubscribeRequest <% for (int j = 0; j < messageList.size(); j++){ SubscribeRequest = messageList.get(j).getData(); String subscriber = (String) SubscribeRequest.getKey(); String topic = (String) SubscribeRequest.getValue(); TopicSubscriber.put(new PairOfString(topic, subscriber)); C... |
DVS_042 | SES | Attribute Domains | In the car purchasing SES, define that 'Vehicle' has attributes 'VIN' (int) and 'Weight' (double). | Vehicle has VIN and Weight! The range of Vehicle’s VIN is int! The range of Vehicle’s Weight is double! |
DVS_043 | SES | Hierarchy & Logic | Define that 'Ford' can be of models 'Fusion' or 'Focus', and 'Buyer' has 'Name', 'SSN', and 'Address' as strings. | Ford can be Fusion or Focus in model! Buyer has Name, SSN, and Address! The range of Buyer’s Name is string! The range of Buyer’s SSN is string! The range of Buyer’s Address is string! |
DVS_044 | Mapping | Value Transfer | Map the value of attribute 'EventTime' from SES 'PacketInfo' to attribute 'EventTime' of SES 'EventInfo'. | transfer PacketInfo’s EventTime value to EventInfo’s EventTime |
DVS_045 | Mapping | Contextual Transfer | Transfer the 'IPAddress' from 'AddressSection' specifically under 'DestHost' to the 'IPAddress' of 'DestIp'. | transfer AddressSection’s IPAddress under DestHost to DestIp’s IPAddress |
DVS_046 | Mapping | Multi-Entity Index | Transfer the 'portNumber' from the first instance (index 0) of 'Port' under 'SrcHost' to the 'portNumber' of 'SrcPort'. | transfer Port.0’s portNumber under Ports under SrcHost to SrcPort’s portNumber |
DVS_047 | Mapping | Multi-aspect Pairing | Establish a correspondence between occurrences of the 'source' entity and those of the 'target'. | pairUp <source>’s <entity> with <target>’s <entity> |
DVS_048 | Elaboration | XML Generation | Implement the internal event to generate a new PES and XML instance from a packet SES file, incrementing the counter. | Internal event for sendOutput <% generatePrunings.setSeed(6879345 + count * 9); String XMLFile = util.ContentsWork.createNewXMLInst("DataHandling", "PacketInfoSes.txt", "PacketInfoPrune.txt"); sp = new SesPesPair(); sp.setXMLFile(XMLFile); count ++; %>! |
DVS_049 | FDDEVS | Distributed Logic | In the 'MapNDistribute' model, define the transition: upon receiving 'DataRequest' in state 'waitforDataRequest', transition to 'sendLANDXML'. | when in waitforDataRequest and receive DataRequest go to sendLANDXML! hold in sendLANDXML for time 1! after sendLANDXML output LANDXML! |
DVS_050 | Elaboration | Dynamic Model Mgmt | Implement Java logic to dynamically add a child model ('storedActor') and create its couplings upon receiving a message. | external event for waitForActor with Actor <% storedActor = messageList.get(0).getData(); CoupledModelImpl parent = (CoupledModelImpl) this.getParent(); parent.addChildModel(storedActor); parent.addCoupling(this.getName(),"outHello","Actor","inHello"); %>! |
DVS_051 | SES | Multi-level Decomp | In the satellite SES, define that under the 'activity' perspective, 'SatelliteModule' is composed of: 'Energizing', 'Propulsing', 'Communicating', 'Navigating', 'Controlling', and 'Sensing'. | From the activity perspective, SatelliteModule is made of Energizing, Propulsing, Communicating, Navigating, Controlling, and Sensing! |
DVS_052 | SES | Nested Spec | Define that 'Sensor' can be 'Visual', 'InfraRed', 'Radar', or 'MultiCapability' in the 'EMType' specialization. | Sensor can be Visual, InfraRed, Radar, or MultiCapability in EMType! |
DVS_053 | Pruning | Context Selection | Perform a pruning operation to select 'Radar' from the 'EMType' specialization for all 'Sensor'. | select Radar from EMType for Sensor! |
DVS_054 | Pruning | Restructuring | Use a restructuring operation to eliminate the 'Radar' option wherever 'Sensor' occurs in the SES. | don’t select Radar under Sensor! |
DVS_055 | Pruning | Count Bounds | Establish a constraint to accept only PESs that have between 0 and 2 instances of 'Visual_Sensor'. | set count bounds for Visual_Sensor as! |
DVS_056 | Pruning | Monolithic vs Cluster | Define count bounds for 'SatelliteModule' as exactly 1 for a monolithic case and between 3 and 6 for a cluster. | set count bounds for SatelliteModule as! set count bounds for SatelliteModule as! |
DVS_057 | Pruning | Presence Logic | Use the 'presence' specialization to ensure that 'CommInterSatelliteLink' is present in the PES. | select Present from presence for CommInterSatelliteLink! |
DVS_058 | SES | Physical Model Def | In the SES of the physical model 'FrontierPMS', define that 'SatelliteModule' has an attribute 'ID' of type int. | SatelliteModule has ID! The range of SatelliteModule’s ID is int! |
DVS_059 | SES | Module Taxonomy | Define that a 'SatelliteModule' can be an 'ImageSat' or a 'RelaySat' in the 'moduleType' specialization. | SatelliteModule can be ImageSat or RelaySat in moduleType! |
DVS_060 | SES | Domain Attributes | In the 'image' perspective, define that 'ImageSat' is composed of 'SensorModule', 'CommModule', and 'Orbit', and assign to 'SensorModule' the fields 'fov', 'viewRange', and 'imageBits'. | From the image perspective, ImageSat is made of SensorModule, CommModule, and Orbit! SensorModule has fov, viewRange, and imageBits! |
DVS_061 | SES | Distributed Protocol | In the 'DEVSDistributedSim' SES, define that the 'Coordinator' sends 'GetTN', 'GetOutput', 'StoreInput', and 'DoDelta' to all 'Simulator' (all). | From the protocol perspective, Coordinator sends GetTN to all Simulator! From the protocol perspective, Coordinator sends GetOutput to all Simulator! From the protocol perspective, Coordinator sends StoreInput to all Simulator! From the protocol perspective, Coordinator sends DoDelta to all Simulator! |
DVS_062 | FDDEVS | Peer Coordinator | In the 'CoordinatorPeer', after receiving 'MyTN', the model should transition to 'sendSendOutput' with time 0 and generate output 'SendOutput'. | when in waitForAllTN and receive MyTN go to sendSendOutput! hold in sendSendOutput for time 0! after sendSendOutput output SendOutput! |
DVS_063 | FDDEVS | Peer Simulator | The 'SimulatorPeer', upon receiving 'SendOutput', should transition to 'sendMyOutput', wait 0 seconds, and transition to 'waitForStoreInput'. | when in waitForGetSendOutput and receive SendOutput go to sendMyOutput! hold in sendMyOutput for time 0! after sendMyOutput output MyOutput! from sendMyOutput go to waitForStoreInput! |
DVS_064 | SES | P2P Coupling | In the 'protocolPeer' perspective, define direct coupling where all 'SimulatorPeer' send 'outMyOutput' to all others as 'inStoreInput'. | From the protocolPeer perspective, all SimulatorPeer sends outMyOutput to all SimulatorPeer as inStoreInput! |
DVS_065 | FDDEVS | Real-Time Sim | In 'SimulatorRTPeer', define that the model waits in 'sendMyOutput' for 'modelTimeAdvance' time and, upon receiving 'Stop', returns to 'waitForStart'. | hold in sendMyOutput for time "modelTimeAdvance"! after sendMyOutput output MyOutput! when in sendMyOutput and receive Stop go to waitForStart! |
DVS_066 | Elaboration | Sim Variables | Declare state variables 'tN', 'tL', and 't' as double, and 'myModel' as 'AtomicModelImpl'. | use tN with type double! use tL with type double! use t with type double! use myModel with type AtomicModelImpl! |
DVS_067 | Elaboration | Sim Initialization | Implement Simulator initialization: instantiate 'myModel', call 'initialize()', set 'tL' to 0, and compute 'tN' as 'tL' plus the model time advance. | Initialize variables <% myModel = new AtomicModelImpl("MyModel"); myModel.initialize(); tL = 0; tN = tL + myModel.getTimeAdvance(); t = 0; %>! |
DVS_068 | Elaboration | Sim External Event | In the Simulator, upon receiving 'GetOutput', extract the current time value from the message and store it in variable 't'. | external event for waitForGetOutput with GetOutput <% $t = messageList.get(0).getData().getValue();$ %>! |
DVS_069 | Elaboration | Sim Output Event | Implement the output event 'sendMyOutput': create a 'NamedMessage' with the model name and the result of 'computeOutput(t)', adding it to the output port. | output event for sendMyOutput <% NamedMessage sm = new NamedMessage(getName(),computeOutput(t)); output.add(outMyOutput,sm); %>! |
DVS_070 | Elaboration | Coord External Event | In the Coordinator, implement logic to reset 'tN' to the maximum value when starting to collect next-event times from simulators. | external event for waitForAllTN with MyTN <% tN = Double.MAX_VALUE; %>! |
DVS_071 | SES | Dynamic Structure | Set the SES to 'AgentAndActor' in the 'dynamic' perspective, where the coupling allows the system to send an 'Actor' to the 'Agent' and vice versa. | From the dynamic perspective, AgentAndActor is made of Agent! From the dynamic perspective, AgentAndActor sends Actor to Agent! From the dynamic perspective, Agent sends Actor to AgentAndActor! |
DVS_072 | Elaboration | Dynamic Model Mgmt | Use the dynamic structure method to add the 'Actor' model as a child of the current coupled model.
Implement the command to create a coupling between the output port 'outHello' of the current Agent (this) and the input port 'inHello' of the 'Actor' component. | addChildModel(Actor); |
DVS_073 | Elaboration | Dynamic Coupling | Implement the command to create a coupling between the output port 'outHello' of the current Agent (this) and the input port 'inHello' of the 'Actor' component. | addCoupling(this.getName(), "outHello", "Actor", "inHello"); |
DVS_074 | Elaboration | Model Removal | Use the correct method to remove the 'Actor' model from the simulation system. | removeChildModel(Actor); |
DVS_075 | FDDEVS | Publisher Init | Set the initial state of a 'Publisher' that waits 0 seconds to issue a 'PublishRequest'. | to start hold in doPublishRequest for time 0.0! after doPublishRequest output PublishRequest! |
DVS_076 | FDDEVS | Topic Update | In 'Publisher', after the publication request, move to 'sendTopicUpdate' with an update cycle of 10 time units. | from doPublishRequest go to sendTopicUpdate! hold in sendTopicUpdate for time 10.0! after sendTopicUpdate output TopicUpdate! from sendTopicUpdate go to sendTopicUpdate! |
DVS_077 | FDDEVS | Subscriber Init | Set the initial behavior of a 'Subscriber': wait 1 second and then generate a 'SubscribeRequest'. | to start hold in doSubscribeRequest for time 1! after doSubscribeRequest output SubscribeRequest! |
DVS_078 | FDDEVS | Subscriber Passive | After the registration request, the 'Subscriber' must remain idle in the 'waitForUpdateToSubscribers' state until it receives an update. | from doSubscribeRequest go to waitForUpdateToSubscribers! passivate in waitForUpdateToSubscribers! |
DVS_079 | FDDEVS | Subscriber Loop | Set the 'Subscriber' to return to the waiting state whenever it receives the 'UpdateToSubscribers' message. | when in waitForUpdateToSubscribers and receive UpdateToSubscribers go to waitForUpdateToSubscribers! |
DVS_080 | Elaboration | Data Type | Define an Abscissa object with the attribute value of type Integer and declare a variable abscissa of this type. | A Abscissa has a value! the range of Abscissa's value is Integer! use abscissa with type Abscissa! |
DVS_081 | Elaboration | Data Type | Define an Ordinate object with the attribute value of type Integer and declare a variable ordinate of this type. | A Ordinate has a value! the range of Ordinate's value is Integer! use ordinate with type Ordinate! |
DVS_082 | Elaboration | Data Type | Define a composite object CrowdCoordinate with the attributes x (Abscissa) and y (Ordinate), and declare the corresponding variable. | A CrowdCoordinate has x and y! the range of CrowdCoordinate's x is Abscissa! the range of CrowdCoordinate's y is Ordinate! use crowdCoordinate with type CrowdCoordinate! |
DVS_083 | Elaboration | Data Type | Define an Image object with the attributes name and extension of type String, and declare the corresponding variable. | A Image has name and extension! the range of Image's name is String! the range of Image's extension is String! use image with type Image! |
DVS_084 | Elaboration | Data Type | Define the PowerLevel and PowerThreshold objects, both with an attribute value of type Integer, and declare their variables. | A PowerLevel has a value! use powerLevel with type PowerLevel! A PowerThreshold has a value! use powerThreshold with type PowerThreshold! |
DVS_085 | Elaboration | Data Type | Define a Perception object with the attributes value, valueMin, and valueMax of type Integer, and a PerceptionThreshold with an integer value. | A Perception has a value, valueMin and valueMax! ... use perceptionThreshold with type PerceptionThreshold! |
DVS_086 | Elaboration | Tagged Block (Init) | Initialize the sensor variables: generate random numbers and instantiate objects with initial values (Perception valueMax=6, Threshold 0). | <%
java.util.Random generator = new java.util.Random(); //in case of necessity to coordinate generation
int number1 = generator.nextInt(10);
int number2 = generator.nextInt(10);
abscissa = new Abscissa(new Integer(0));
ordinate = new Ordinate(new Integer(0));
crowdCoordinate = new CrowdCoordinate(new Abscissa(... |
DVS_087 | Protocol | Port Configuration | Set the sensor to generate output on the PowerLevel, VisualPerception, Capture, and Coordinate ports with their respective types. | generates output on PowerLevel with type PowerLevel!
generates output on VisualPerception with type Perception!
generates output on Capture with type Image!
generates output on Coordinate with type CrowdCoordinate! |
DVS_088 | FDEVS | Cyclic State Machine | Define a cycle of states s0→s1→s2→s3→s4→s0, with specific durations and outputs mapped for each initial state. | to start hold in s0 for time 2!
after s0 output PowerLevel!
from s0 go to s1!
hold in s1 for time 1!
after s1 output VisualPerception!
from s1 go to s2!
hold in s2 for time 1!
after s2 output Capture!
from s2 go to s3!
hold in s3 for time 1!
after s3 output Coordinate!
from s3 go to s4!
hold in s4 for time ... |
DVS_089 | Elaboration | Tagged Block (Output) | Implement the sensor output events: add the objects to the corresponding output ports (outPowerLevel, outVisualPerception, etc). | <%
output.add(outPowerLevel, powerLevel);
%>!
output event for s1
<%
output.add(outVisualPerception, perception);
%>!
output event for s2
<%
output.add(outCapture, image);
%>!
output event for s3
<%
output.add(outCoordinate, crowdCoordinate);
%>! |
DVS_090 | Elaboration | Data Type | Define a composite object DroneCoordinate with the attributes x (Abscissa) and y (Ordinate), and declare the corresponding variable. | A Abscissa has a value!
the range of Abscissa's value is Integer!
use abscissa with type Abscissa!
A Ordinate has a value!
the range of Ordinate's value is Integer!
use ordinate with type Ordinate!
A DroneCoordinate has x and y!
the range of DroneCoordinate's x is Abscissa!
the range of DroneCoordinate's y is O... |
DVS_091 | Elaboration | Data Type | Define a WaterDepth object with a value attribute of type Integer and declare the corresponding variable. | A WaterDepth has a value! the range of WaterDepth's value is Integer! use waterDepth with type WaterDepth! |
DVS_092 | Elaboration | Data Type | Define a WaterThreshold object with a value attribute of type Integer and declare the corresponding variable. | A WaterThreshold has a value! the range of WaterThreshold's value is Integer! use waterThreshold with type WaterThreshold! |
DVS_093 | Elaboration | Data Type | Define a DistanceFlown object with a value attribute of type Integer and declare the corresponding variable. | A DistanceFlown has a value! the range of DistanceFlown's value is Integer! use distanceFlown with type DistanceFlown! |
DVS_094 | Elaboration | Tagged Block (Init) | Initialize the drone's variables: instantiate Abscissa, Ordinate, DroneCoordinate, WaterDepth, PowerThreshold, DistanceFlown, Image, WaterThreshold, and PowerLevel with a value of 0. | Initialize variables
<%
java.util.Random generator = new java.util.Random(); //in case of necessity to coordinate generation
int number1 = generator.nextInt(10);
int number2 = generator.nextInt(10);
abscissa = new Abscissa(new Integer(0));
ordinate = new Ordinate(new Integer(0));
droneCoordinate = new DroneCo... |
DVS_095 | Protocol | Port Configuration | Configure the drone to generate output on the Water (WaterDepth), PowerLevel (PowerLevel), Coordinate (DroneCoordinate), and Capture (Image) ports. | generates output on Water with type WaterDepth!
generates output on PowerLevel with type PowerLevel!
generates output on Coordinate with type DroneCoordinate!
generates output on Capture with type Image! |
DVS_096 | FDEVS | Cyclic State Machine | Define a cycle s0→s1→s2→s3→s4→s0 where s0 lasts 2 units and the others 1 unit, with outputs in s0, s1, s2, and s3. | to start hold in s0 for time 2!
after s0 output Water!
from s0 go to s1!
hold in s1 for time 1!
after s1 output PowerLevel!
from s1 go to s2!
hold in s2 for time 1!
after s2 output Coordinate!
from s2 go to s3!
hold in s3 for time 1!
after s3 output Capture!
from s3 go to s4!
hold in s4 for time 1!
from s4... |
DVS_097 | Elaboration | Tagged Block (Output) | Implement the drone's output events: add the objects to the outWater, outPowerLevel, outCoordinate, and outCapture ports. | <%
output.add(outWater, waterDepth);
%>!
output event for s1
<%
output.add(outPowerLevel, powerLevel);
%>!
output event for s2
<%
output.add(outCoordinate, droneCoordinate);
%>!
output event for s3
<%
output.add(outCapture, image);
%>! |
DVS_098 | Elaboration | Variables | Declare four integer counters: countCoordinateReceived, countVisualPerceptionReceived, countperceptionThreshold, and countCaptureReceived. | use countCoordinateReceived with type int!
use countVisualPerceptionReceived with type int!
use countperceptionThreshold with type int!
use countCaptureReceived with type int!
use mS4MESimulationInterface with type MS4MESimulationInterface! |
DVS_099 | Elaboration | Variables | Declare a variable mS4MESimulationInterface of type MS4MESimulationInterface. | use mS4MESimulationInterface with type MS4MESimulationInterface! |
DVS_100 | Elaboration | Library Import | Add Java libraries (Date, Random, ArrayList, Math) and the DEVS AtomicModel interface. | add library
<%
import java.util.Date;
import java.util.Calendar;
import java.util.Random;
import java.util.ArrayList;
import static java.lang.Math.*;
import com.ms4systems.devs.core.model.AtomicModel;
%>! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.