CentralizedQProtocol

Description

Functions

virtual double getCurrentPosition () override { return currentDistance; };

virtual double getMaximumPosition () override { return totalMissionLength; };

getCollectedPackets

uint32_t getCollectedPackets() override { return collectedPackets; };

getMaxCollectedPackets

uint32_t getMaxCollectedPackets() override { return packetLimit; };

applyCommand

virtual void applyCommand(const LocalControl& command) override;

Applies a command to the agent

cMessage

cMessage* requestTimer = new cMessage();

cMessage

cMessage* communicationDelayTimer = new cMessage();

initialize

virtual void initialize(int stage) override;

OMNeT++ and INET functions

numInitStages

virtual int numInitStages() const override { return 3; };

handleMessage

virtual void handleMessage(cMessage *msg) override;

handleTelemetry

virtual void handleTelemetry(Telemetry *telemetry) override;

Handles telemetry received by the mobility module and uses it to compute the mobility component of the current state. The most current telemetry message is saved.

handlePacket

virtual void handlePacket(Packet *pk) override;

Handles packets received by the communication module. These packet can be from other UAVs, sensors and the ground station. This function implements the specific behavior triggered by the reception of these packet types.

communicate

virtual void communicate(int targetAgent, NodeType targetType, MessageType messageType);

Helper function that sends a network messages with content specified by the function's parameters

reverse

virtual void reverse();

Helper function that reverses the course of the UAVs movement

stop

virtual void stop();

resume

virtual void resume();