Commit a30cf69c authored by DaiJiabin's avatar DaiJiabin
Browse files

more info in msg, functions added

parent 0d44ebe6
version 2
run General-0-20220617-10:21:19-9550
attr configname General
attr datetime 20220617-10:21:19
attr experiment General
attr inifile omnetpp.ini
attr iterationvars ""
attr iterationvarsf ""
attr measurement ""
attr network org.car2x.veins.nodes.Scenario
attr processid 9550
attr repetition 0
attr replication #0
attr resultdir results
attr runnumber 0
attr seedset 0
param *.playgroundSizeX 3000m
param *.playgroundSizeY 2000m
param *.playgroundSizeZ 50m
param *.manager.updateInterval 1s
param *.manager.host "\"localhost\""
param *.manager.port 9999
param *.manager.autoShutdown true
param *.manager.launchConfig "xmldoc(\"veins.launchd.xml\")"
param *.annotations.draw true
param *.connectionManager.sendDirect true
param *.connectionManager.maxInterfDist 500m
param *.connectionManager.drawMaxIntfDist false
param *.**.nic.mac1609_4.useServiceChannel false
param *.**.nic.mac1609_4.txPower 20mW
param *.**.nic.mac1609_4.bitrate 6Mbps
param *.**.nic.phy80211p.minPowerLevel -110dBm
param *.**.nic.phy80211p.useNoiseFloor true
param *.**.nic.phy80211p.noiseFloor -98dBm
param *.**.nic.phy80211p.decider "xmldoc(\"config.xml\")"
param *.**.nic.phy80211p.analogueModels "xmldoc(\"config.xml\")"
param *.**.nic.phy80211p.usePropagationDelay true
param *.**.nic.phy80211p.antenna "xmldoc(\"antenna.xml\", \"/root/Antenna[@id='monopole']\")"
param *.node[*].nic.phy80211p.antennaOffsetY "0 m"
param *.node[*].nic.phy80211p.antennaOffsetZ "0 m"
param *.node[*].applType "\"InteractingVehicle\""
param *.node[*].appl.headerLength "88 bit"
param *.node[*].appl.dataLengthBits "512 bit"
param *.node[*].appl.sendBeacons false
param *.node[*].appl.dataOnSch false
param *.node[*].appl.beaconInterval 1s
param *.node[*].appl.threshold 2
param *.node[*].appl.givenTime 7
param *.node[*].veinsmobility.x 0
param *.node[*].veinsmobility.y 0
param *.node[*].veinsmobility.z 0
scalar Scenario.node[0].appl generatedWSMs 0
scalar Scenario.node[0].appl receivedWSMs 0
scalar Scenario.node[0].appl generatedBSMs 131
scalar Scenario.node[0].appl receivedBSMs 0
scalar Scenario.node[0].appl generatedWSAs 0
scalar Scenario.node[0].appl receivedWSAs 0
scalar Scenario.node[0].nic.phy80211p busyTime 0.00035309589041096
scalar Scenario.node[0].nic.mac1609_4 ReceivedUnicastPackets 0
scalar Scenario.node[0].nic.mac1609_4 ReceivedBroadcasts 537
scalar Scenario.node[0].nic.mac1609_4 SentPackets 131
scalar Scenario.node[0].nic.mac1609_4 SentAcknowledgements 0
scalar Scenario.node[0].nic.mac1609_4 RetriesExceeded 0
scalar Scenario.node[0].nic.mac1609_4 SNIRLostPackets 0
scalar Scenario.node[0].nic.mac1609_4 RXTXLostPackets 0
scalar Scenario.node[0].nic.mac1609_4 TotalLostPackets 0
scalar Scenario.node[0].nic.mac1609_4 DroppedPacketsInMac 0
scalar Scenario.node[0].nic.mac1609_4 TooLittleTime 0
scalar Scenario.node[0].nic.mac1609_4 TimesIntoBackoff 131
scalar Scenario.node[0].nic.mac1609_4 SlotsBackoff 217
scalar Scenario.node[0].nic.mac1609_4 NumInternalContention 0
scalar Scenario.node[0].nic.mac1609_4 totalBusyTime 0.032195
scalar Scenario.node[0].nic.mac1609_4 retriesExceeded:count 0
attr source org_car2x_veins_modules_mac_sigRetriesExceeded
scalar Scenario.node[0].nic.mac1609_4 sentAcks:count 0
attr source org_car2x_veins_modules_mac_sigSentAck
scalar Scenario.node[0].nic.mac1609_4 sentPackets:count 131
attr source org_car2x_veins_modules_mac_sigSentPacket
scalar Scenario.node[0].nic.mac1609_4 collisions:count 0
attr source org_car2x_veins_modules_mac_sigCollision
scalar Scenario.node[0].nic.mac1609_4 channelBusy:timeavg 0.00044102739726027
attr source org_car2x_veins_modules_mac_sigChannelBusy
scalar Scenario.node[0].veinsmobility startTime 8
scalar Scenario.node[0].veinsmobility totalTime 72
scalar Scenario.node[0].veinsmobility stopTime 81
scalar Scenario.node[0].veinsmobility minSpeed 1.4645417755703
scalar Scenario.node[0].veinsmobility maxSpeed 15.490697030161
scalar Scenario.node[0].veinsmobility totalDistance 988.12431504692
scalar Scenario.node[0].veinsmobility totalCO2Emission 209.8012198201
scalar Scenario.node[1].appl generatedWSMs 0
scalar Scenario.node[1].appl receivedWSMs 0
scalar Scenario.node[1].appl generatedBSMs 137
scalar Scenario.node[1].appl receivedBSMs 0
scalar Scenario.node[1].appl generatedWSAs 0
scalar Scenario.node[1].appl receivedWSAs 0
scalar Scenario.node[1].nic.phy80211p busyTime 0.00041936842105263
scalar Scenario.node[1].nic.mac1609_4 ReceivedUnicastPackets 0
scalar Scenario.node[1].nic.mac1609_4 ReceivedBroadcasts 664
scalar Scenario.node[1].nic.mac1609_4 SentPackets 137
scalar Scenario.node[1].nic.mac1609_4 SentAcknowledgements 0
scalar Scenario.node[1].nic.mac1609_4 RetriesExceeded 0
scalar Scenario.node[1].nic.mac1609_4 SNIRLostPackets 0
scalar Scenario.node[1].nic.mac1609_4 RXTXLostPackets 0
scalar Scenario.node[1].nic.mac1609_4 TotalLostPackets 0
scalar Scenario.node[1].nic.mac1609_4 DroppedPacketsInMac 0
scalar Scenario.node[1].nic.mac1609_4 TooLittleTime 0
scalar Scenario.node[1].nic.mac1609_4 TimesIntoBackoff 137
scalar Scenario.node[1].nic.mac1609_4 SlotsBackoff 212
scalar Scenario.node[1].nic.mac1609_4 NumInternalContention 0
scalar Scenario.node[1].nic.mac1609_4 totalBusyTime 0.038585
scalar Scenario.node[1].nic.mac1609_4 retriesExceeded:count 0
attr source org_car2x_veins_modules_mac_sigRetriesExceeded
scalar Scenario.node[1].nic.mac1609_4 sentAcks:count 0
attr source org_car2x_veins_modules_mac_sigSentAck
scalar Scenario.node[1].nic.mac1609_4 sentPackets:count 137
attr source org_car2x_veins_modules_mac_sigSentPacket
scalar Scenario.node[1].nic.mac1609_4 collisions:count 0
attr source org_car2x_veins_modules_mac_sigCollision
scalar Scenario.node[1].nic.mac1609_4 channelBusy:timeavg 0.00050769736842105
attr source org_car2x_veins_modules_mac_sigChannelBusy
scalar Scenario.node[1].veinsmobility startTime 15
scalar Scenario.node[1].veinsmobility totalTime 75
scalar Scenario.node[1].veinsmobility stopTime 91
scalar Scenario.node[1].veinsmobility minSpeed 2.5007992214756
scalar Scenario.node[1].veinsmobility maxSpeed 14.48455213342
scalar Scenario.node[1].veinsmobility totalDistance 981.89438741434
scalar Scenario.node[1].veinsmobility totalCO2Emission 203.62720393475
scalar Scenario.node[2].appl generatedWSMs 0
scalar Scenario.node[2].appl receivedWSMs 0
scalar Scenario.node[2].appl generatedBSMs 144
scalar Scenario.node[2].appl receivedBSMs 0
scalar Scenario.node[2].appl generatedWSAs 0
scalar Scenario.node[2].appl receivedWSAs 0
scalar Scenario.node[2].nic.phy80211p busyTime 0.00044962025316455
scalar Scenario.node[2].nic.mac1609_4 ReceivedUnicastPackets 0
scalar Scenario.node[2].nic.mac1609_4 ReceivedBroadcasts 740
scalar Scenario.node[2].nic.mac1609_4 SentPackets 144
scalar Scenario.node[2].nic.mac1609_4 SentAcknowledgements 0
scalar Scenario.node[2].nic.mac1609_4 RetriesExceeded 0
scalar Scenario.node[2].nic.mac1609_4 SNIRLostPackets 0
scalar Scenario.node[2].nic.mac1609_4 RXTXLostPackets 0
scalar Scenario.node[2].nic.mac1609_4 TotalLostPackets 0
scalar Scenario.node[2].nic.mac1609_4 DroppedPacketsInMac 0
scalar Scenario.node[2].nic.mac1609_4 TooLittleTime 0
scalar Scenario.node[2].nic.mac1609_4 TimesIntoBackoff 145
scalar Scenario.node[2].nic.mac1609_4 SlotsBackoff 215
scalar Scenario.node[2].nic.mac1609_4 NumInternalContention 0
scalar Scenario.node[2].nic.mac1609_4 totalBusyTime 0.042576
scalar Scenario.node[2].nic.mac1609_4 retriesExceeded:count 0
attr source org_car2x_veins_modules_mac_sigRetriesExceeded
scalar Scenario.node[2].nic.mac1609_4 sentAcks:count 0
attr source org_car2x_veins_modules_mac_sigSentAck
scalar Scenario.node[2].nic.mac1609_4 sentPackets:count 144
attr source org_car2x_veins_modules_mac_sigSentPacket
scalar Scenario.node[2].nic.mac1609_4 collisions:count 0
attr source org_car2x_veins_modules_mac_sigCollision
scalar Scenario.node[2].nic.mac1609_4 channelBusy:timeavg 0.00053893670886076
attr source org_car2x_veins_modules_mac_sigChannelBusy
scalar Scenario.node[2].veinsmobility startTime 18
scalar Scenario.node[2].veinsmobility totalTime 78
scalar Scenario.node[2].veinsmobility stopTime 97
scalar Scenario.node[2].veinsmobility minSpeed 2.0300680076936
scalar Scenario.node[2].veinsmobility maxSpeed 14.198897595677
scalar Scenario.node[2].veinsmobility totalDistance 979.63051521019
scalar Scenario.node[2].veinsmobility totalCO2Emission 207.58487703686
scalar Scenario.node[3].appl generatedWSMs 0
scalar Scenario.node[3].appl receivedWSMs 0
scalar Scenario.node[3].appl generatedBSMs 140
scalar Scenario.node[3].appl receivedBSMs 0
scalar Scenario.node[3].appl generatedWSAs 0
scalar Scenario.node[3].appl receivedWSAs 0
scalar Scenario.node[3].nic.phy80211p busyTime 0.00046830769230769
scalar Scenario.node[3].nic.mac1609_4 ReceivedUnicastPackets 0
scalar Scenario.node[3].nic.mac1609_4 ReceivedBroadcasts 761
scalar Scenario.node[3].nic.mac1609_4 SentPackets 140
scalar Scenario.node[3].nic.mac1609_4 SentAcknowledgements 0
scalar Scenario.node[3].nic.mac1609_4 RetriesExceeded 0
scalar Scenario.node[3].nic.mac1609_4 SNIRLostPackets 0
scalar Scenario.node[3].nic.mac1609_4 RXTXLostPackets 0
scalar Scenario.node[3].nic.mac1609_4 TotalLostPackets 0
scalar Scenario.node[3].nic.mac1609_4 DroppedPacketsInMac 0
scalar Scenario.node[3].nic.mac1609_4 TooLittleTime 0
scalar Scenario.node[3].nic.mac1609_4 TimesIntoBackoff 140
scalar Scenario.node[3].nic.mac1609_4 SlotsBackoff 215
scalar Scenario.node[3].nic.mac1609_4 NumInternalContention 0
scalar Scenario.node[3].nic.mac1609_4 totalBusyTime 0.043388
scalar Scenario.node[3].nic.mac1609_4 retriesExceeded:count 0
attr source org_car2x_veins_modules_mac_sigRetriesExceeded
scalar Scenario.node[3].nic.mac1609_4 sentAcks:count 0
attr source org_car2x_veins_modules_mac_sigSentAck
scalar Scenario.node[3].nic.mac1609_4 sentPackets:count 140
attr source org_car2x_veins_modules_mac_sigSentPacket
scalar Scenario.node[3].nic.mac1609_4 collisions:count 0
attr source org_car2x_veins_modules_mac_sigCollision
scalar Scenario.node[3].nic.mac1609_4 channelBusy:timeavg 0.00055625641025641
attr source org_car2x_veins_modules_mac_sigChannelBusy
scalar Scenario.node[3].veinsmobility startTime 21
scalar Scenario.node[3].veinsmobility totalTime 77
scalar Scenario.node[3].veinsmobility stopTime 99
scalar Scenario.node[3].veinsmobility minSpeed 2.2569679071428
scalar Scenario.node[3].veinsmobility maxSpeed 14.070183269891
scalar Scenario.node[3].veinsmobility totalDistance 978.68896558631
scalar Scenario.node[3].veinsmobility totalCO2Emission 209.15284474626
This diff is collapsed.
This diff is collapsed.
......@@ -26,7 +26,11 @@ packet InterVehicleMessage extends veins::DemoSafetyMessage {
// added vehicleId to identify vehicles
int vehicleId;
string roadId;
double tanValue;
double offset;
double distanceToIntersection;
veins::Coord position;
// added speed into the package
veins::Coord speed;
double doubleSpeed;
}
......@@ -182,6 +182,10 @@ Register_Class(InterVehicleMessage)
InterVehicleMessage::InterVehicleMessage(const char *name, short kind) : ::veins::DemoSafetyMessage(name,kind)
{
this->vehicleId = 0;
this->tanValue = 0;
this->offset = 0;
this->distanceToIntersection = 0;
this->doubleSpeed = 0;
}
InterVehicleMessage::InterVehicleMessage(const InterVehicleMessage& other) : ::veins::DemoSafetyMessage(other)
......@@ -205,8 +209,12 @@ void InterVehicleMessage::copy(const InterVehicleMessage& other)
{
this->vehicleId = other.vehicleId;
this->roadId = other.roadId;
this->tanValue = other.tanValue;
this->offset = other.offset;
this->distanceToIntersection = other.distanceToIntersection;
this->position = other.position;
this->speed = other.speed;
this->doubleSpeed = other.doubleSpeed;
}
void InterVehicleMessage::parsimPack(omnetpp::cCommBuffer *b) const
......@@ -214,8 +222,12 @@ void InterVehicleMessage::parsimPack(omnetpp::cCommBuffer *b) const
::veins::DemoSafetyMessage::parsimPack(b);
doParsimPacking(b,this->vehicleId);
doParsimPacking(b,this->roadId);
doParsimPacking(b,this->tanValue);
doParsimPacking(b,this->offset);
doParsimPacking(b,this->distanceToIntersection);
doParsimPacking(b,this->position);
doParsimPacking(b,this->speed);
doParsimPacking(b,this->doubleSpeed);
}
void InterVehicleMessage::parsimUnpack(omnetpp::cCommBuffer *b)
......@@ -223,8 +235,12 @@ void InterVehicleMessage::parsimUnpack(omnetpp::cCommBuffer *b)
::veins::DemoSafetyMessage::parsimUnpack(b);
doParsimUnpacking(b,this->vehicleId);
doParsimUnpacking(b,this->roadId);
doParsimUnpacking(b,this->tanValue);
doParsimUnpacking(b,this->offset);
doParsimUnpacking(b,this->distanceToIntersection);
doParsimUnpacking(b,this->position);
doParsimUnpacking(b,this->speed);
doParsimUnpacking(b,this->doubleSpeed);
}
int InterVehicleMessage::getVehicleId() const
......@@ -247,6 +263,36 @@ void InterVehicleMessage::setRoadId(const char * roadId)
this->roadId = roadId;
}
double InterVehicleMessage::getTanValue() const
{
return this->tanValue;
}
void InterVehicleMessage::setTanValue(double tanValue)
{
this->tanValue = tanValue;
}
double InterVehicleMessage::getOffset() const
{
return this->offset;
}
void InterVehicleMessage::setOffset(double offset)
{
this->offset = offset;
}
double InterVehicleMessage::getDistanceToIntersection() const
{
return this->distanceToIntersection;
}
void InterVehicleMessage::setDistanceToIntersection(double distanceToIntersection)
{
this->distanceToIntersection = distanceToIntersection;
}
veins::Coord& InterVehicleMessage::getPosition()
{
return this->position;
......@@ -267,6 +313,16 @@ void InterVehicleMessage::setSpeed(const veins::Coord& speed)
this->speed = speed;
}
double InterVehicleMessage::getDoubleSpeed() const
{
return this->doubleSpeed;
}
void InterVehicleMessage::setDoubleSpeed(double doubleSpeed)
{
this->doubleSpeed = doubleSpeed;
}
class InterVehicleMessageDescriptor : public omnetpp::cClassDescriptor
{
private:
......@@ -332,7 +388,7 @@ const char *InterVehicleMessageDescriptor::getProperty(const char *propertyname)
int InterVehicleMessageDescriptor::getFieldCount() const
{
omnetpp::cClassDescriptor *basedesc = getBaseClassDescriptor();
return basedesc ? 4+basedesc->getFieldCount() : 4;
return basedesc ? 8+basedesc->getFieldCount() : 8;
}
unsigned int InterVehicleMessageDescriptor::getFieldTypeFlags(int field) const
......@@ -344,12 +400,16 @@ unsigned int InterVehicleMessageDescriptor::getFieldTypeFlags(int field) const
field -= basedesc->getFieldCount();
}
static unsigned int fieldTypeFlags[] = {
FD_ISEDITABLE,
FD_ISEDITABLE,
FD_ISEDITABLE,
FD_ISEDITABLE,
FD_ISEDITABLE,
FD_ISCOMPOUND,
FD_ISCOMPOUND,
FD_ISEDITABLE,
};
return (field>=0 && field<4) ? fieldTypeFlags[field] : 0;
return (field>=0 && field<8) ? fieldTypeFlags[field] : 0;
}
const char *InterVehicleMessageDescriptor::getFieldName(int field) const
......@@ -363,10 +423,14 @@ const char *InterVehicleMessageDescriptor::getFieldName(int field) const
static const char *fieldNames[] = {
"vehicleId",
"roadId",
"tanValue",
"offset",
"distanceToIntersection",
"position",
"speed",
"doubleSpeed",
};
return (field>=0 && field<4) ? fieldNames[field] : nullptr;
return (field>=0 && field<8) ? fieldNames[field] : nullptr;
}
int InterVehicleMessageDescriptor::findField(const char *fieldName) const
......@@ -375,8 +439,12 @@ int InterVehicleMessageDescriptor::findField(const char *fieldName) const
int base = basedesc ? basedesc->getFieldCount() : 0;
if (fieldName[0]=='v' && strcmp(fieldName, "vehicleId")==0) return base+0;
if (fieldName[0]=='r' && strcmp(fieldName, "roadId")==0) return base+1;
if (fieldName[0]=='p' && strcmp(fieldName, "position")==0) return base+2;
if (fieldName[0]=='s' && strcmp(fieldName, "speed")==0) return base+3;
if (fieldName[0]=='t' && strcmp(fieldName, "tanValue")==0) return base+2;
if (fieldName[0]=='o' && strcmp(fieldName, "offset")==0) return base+3;
if (fieldName[0]=='d' && strcmp(fieldName, "distanceToIntersection")==0) return base+4;
if (fieldName[0]=='p' && strcmp(fieldName, "position")==0) return base+5;
if (fieldName[0]=='s' && strcmp(fieldName, "speed")==0) return base+6;
if (fieldName[0]=='d' && strcmp(fieldName, "doubleSpeed")==0) return base+7;
return basedesc ? basedesc->findField(fieldName) : -1;
}
......@@ -391,10 +459,14 @@ const char *InterVehicleMessageDescriptor::getFieldTypeString(int field) const
static const char *fieldTypeStrings[] = {
"int",
"string",
"double",
"double",
"double",
"veins::Coord",
"veins::Coord",
"double",
};
return (field>=0 && field<4) ? fieldTypeStrings[field] : nullptr;
return (field>=0 && field<8) ? fieldTypeStrings[field] : nullptr;
}
const char **InterVehicleMessageDescriptor::getFieldPropertyNames(int field) const
......@@ -463,8 +535,12 @@ std::string InterVehicleMessageDescriptor::getFieldValueAsString(void *object, i
switch (field) {
case 0: return long2string(pp->getVehicleId());
case 1: return oppstring2string(pp->getRoadId());
case 2: {std::stringstream out; out << pp->getPosition(); return out.str();}
case 3: {std::stringstream out; out << pp->getSpeed(); return out.str();}
case 2: return double2string(pp->getTanValue());
case 3: return double2string(pp->getOffset());
case 4: return double2string(pp->getDistanceToIntersection());
case 5: {std::stringstream out; out << pp->getPosition(); return out.str();}
case 6: {std::stringstream out; out << pp->getSpeed(); return out.str();}
case 7: return double2string(pp->getDoubleSpeed());
default: return "";
}
}
......@@ -481,6 +557,10 @@ bool InterVehicleMessageDescriptor::setFieldValueAsString(void *object, int fiel
switch (field) {
case 0: pp->setVehicleId(string2long(value)); return true;
case 1: pp->setRoadId((value)); return true;
case 2: pp->setTanValue(string2double(value)); return true;
case 3: pp->setOffset(string2double(value)); return true;
case 4: pp->setDistanceToIntersection(string2double(value)); return true;
case 7: pp->setDoubleSpeed(string2double(value)); return true;
default: return false;
}
}
......@@ -494,8 +574,8 @@ const char *InterVehicleMessageDescriptor::getFieldStructName(int field) const
field -= basedesc->getFieldCount();
}
switch (field) {
case 2: return omnetpp::opp_typename(typeid(veins::Coord));
case 3: return omnetpp::opp_typename(typeid(veins::Coord));
case 5: return omnetpp::opp_typename(typeid(veins::Coord));
case 6: return omnetpp::opp_typename(typeid(veins::Coord));
default: return nullptr;
};
}
......@@ -510,8 +590,8 @@ void *InterVehicleMessageDescriptor::getFieldStructValuePointer(void *object, in
}
InterVehicleMessage *pp = (InterVehicleMessage *)object; (void)pp;
switch (field) {
case 2: return (void *)(&pp->getPosition()); break;
case 3: return (void *)(&pp->getSpeed()); break;
case 5: return (void *)(&pp->getPosition()); break;
case 6: return (void *)(&pp->getSpeed()); break;
default: return nullptr;
}
}
......
......@@ -33,9 +33,13 @@
* // added vehicleId to identify vehicles
* int vehicleId;
* string roadId;
* double tanValue;
* double offset;
* double distanceToIntersection;
* veins::Coord position;
* // added speed into the package
* veins::Coord speed;
* double doubleSpeed;
* }
* </pre>
*/
......@@ -44,8 +48,12 @@ class InterVehicleMessage : public ::veins::DemoSafetyMessage
protected:
int vehicleId;
::omnetpp::opp_string roadId;
double tanValue;
double offset;
double distanceToIntersection;
veins::Coord position;
veins::Coord speed;
double doubleSpeed;
private:
void copy(const InterVehicleMessage& other);
......@@ -68,12 +76,20 @@ class InterVehicleMessage : public ::veins::DemoSafetyMessage
virtual void setVehicleId(int vehicleId);
virtual const char * getRoadId() const;
virtual void setRoadId(const char * roadId);
virtual double getTanValue() const;
virtual void setTanValue(double tanValue);
virtual double getOffset() const;
virtual void setOffset(double offset);
virtual double getDistanceToIntersection() const;
virtual void setDistanceToIntersection(double distanceToIntersection);
virtual veins::Coord& getPosition();
virtual const veins::Coord& getPosition() const {return const_cast<InterVehicleMessage*>(this)->getPosition();}
virtual void setPosition(const veins::Coord& position);
virtual veins::Coord& getSpeed();
virtual const veins::Coord& getSpeed() const {return const_cast<InterVehicleMessage*>(this)->getSpeed();}
virtual void setSpeed(const veins::Coord& speed);
virtual double getDoubleSpeed() const;
virtual void setDoubleSpeed(double doubleSpeed);
};
inline void doParsimPacking(omnetpp::cCommBuffer *b, const InterVehicleMessage& obj) {obj.parsimPack(b);}
......
This diff is collapsed.
......@@ -54,6 +54,10 @@ protected:
int interval = 1;
double givenTime;
double threshold;
double cosValue;
double sinValue;
double tanValue;
double offset;
long numReceived;
long numSent;
simtime_t localTime;
......@@ -95,6 +99,15 @@ protected:
virtual void visualization_GivenTime(double myTime, double givenTime);
virtual void visualization_Brake(veins::TraCIMobility* mobility, InterVehicleMessage* msg, double myTime, double hisTime, double threshold);
virtual bool checkIntersection(double myTanValue, double hisTanValue);
virtual bool checkForIntersection(double &myTime, double &hisTime, veins::Coord& resPosition, veins::Coord mySpeed, veins::Coord speedFromMessage, veins::Coord myCoord, veins::Coord positionFromMessage);
// speedControl, avoiding emergency brake, mobility is the to be controlled vehicle
// void InteractingVehicle::speedControl(veins::Coord resPosition, veins::Coord myCoord, veins::Coord mySpeed, double myTime, double hisTime, veins::Coord positionFromMessage, veins::Coord speedFromMessage);
// calculate the offset
virtual double calculateOffset(veins::Coord myPosition, double tanValue);
// calculate the intersection position.
virtual void calculateIntersectionPosition(double myTanValue, double myOffset, double hisTanValue, double hisOffset, veins::Coord& resPosition);
};
#endif
No preview for this file type
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment