mobility, buildings: Allow mobility models to be copied
This commit is contained in:
@@ -61,6 +61,12 @@ class RandomWalk2dOutdoorMobilityModel : public MobilityModel
|
||||
MODE_TIME
|
||||
};
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<RandomWalk2dOutdoorMobilityModel>(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Performs the rebound of the node if it reaches a boundary
|
||||
|
||||
@@ -33,6 +33,13 @@ class ConstantAccelerationMobilityModel : public MobilityModel
|
||||
*/
|
||||
ConstantAccelerationMobilityModel();
|
||||
~ConstantAccelerationMobilityModel() override;
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<ConstantAccelerationMobilityModel>(*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the model's velocity and acceleration
|
||||
* @param velocity the velocity (m/s)
|
||||
|
||||
@@ -33,6 +33,12 @@ class ConstantPositionMobilityModel : public MobilityModel
|
||||
ConstantPositionMobilityModel();
|
||||
~ConstantPositionMobilityModel() override;
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<ConstantPositionMobilityModel>(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
Vector DoGetPosition() const override;
|
||||
void DoSetPosition(const Vector& position) override;
|
||||
|
||||
@@ -39,6 +39,12 @@ class ConstantVelocityMobilityModel : public MobilityModel
|
||||
ConstantVelocityMobilityModel();
|
||||
~ConstantVelocityMobilityModel() override;
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<ConstantVelocityMobilityModel>(*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param speed the new speed to set.
|
||||
*
|
||||
|
||||
@@ -78,6 +78,12 @@ class GaussMarkovMobilityModel : public MobilityModel
|
||||
GaussMarkovMobilityModel();
|
||||
~GaussMarkovMobilityModel() override;
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<GaussMarkovMobilityModel>(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Initialize the model and calculate new velocity, direction, and pitch
|
||||
|
||||
@@ -37,6 +37,12 @@ class GeocentricConstantPositionMobilityModel : public MobilityModel
|
||||
GeocentricConstantPositionMobilityModel() = default;
|
||||
~GeocentricConstantPositionMobilityModel() override = default;
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<GeocentricConstantPositionMobilityModel>(*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Computes elevation angle between a ground terminal and a HAPS/Satellite.
|
||||
* After calculating the plane perpendicular to a cartesian position vector,
|
||||
|
||||
@@ -54,6 +54,12 @@ class HierarchicalMobilityModel : public MobilityModel
|
||||
|
||||
HierarchicalMobilityModel();
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<HierarchicalMobilityModel>(*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the child mobility model.
|
||||
*
|
||||
|
||||
@@ -37,6 +37,15 @@ class MOBILITY_EXPORT MobilityModel : public Object
|
||||
MobilityModel();
|
||||
~MobilityModel() override = 0;
|
||||
|
||||
/**
|
||||
* Copy function allows one to copy the underlying MobilityModel
|
||||
* from a MobilityModel pointer, by calling each children Copy implementation.
|
||||
* This is primarily used by wraparound models for the spectrum channel.
|
||||
*
|
||||
* @return a copy of the current mobility model
|
||||
*/
|
||||
virtual Ptr<MobilityModel> Copy() const = 0;
|
||||
|
||||
/**
|
||||
* @return the current position
|
||||
*/
|
||||
|
||||
@@ -42,6 +42,12 @@ class RandomDirection2dMobilityModel : public MobilityModel
|
||||
RandomDirection2dMobilityModel();
|
||||
~RandomDirection2dMobilityModel() override;
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<RandomDirection2dMobilityModel>(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Set a new direction and speed
|
||||
|
||||
@@ -48,6 +48,12 @@ class RandomWalk2dMobilityModel : public MobilityModel
|
||||
|
||||
~RandomWalk2dMobilityModel() override;
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<RandomWalk2dMobilityModel>(*this);
|
||||
}
|
||||
|
||||
/** An enum representing the different working modes of this module. */
|
||||
enum Mode
|
||||
{
|
||||
|
||||
@@ -50,6 +50,12 @@ class RandomWaypointMobilityModel : public MobilityModel
|
||||
|
||||
~RandomWaypointMobilityModel() override;
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<RandomWaypointMobilityModel>(*this);
|
||||
}
|
||||
|
||||
protected:
|
||||
void DoInitialize() override;
|
||||
|
||||
|
||||
@@ -53,6 +53,12 @@ class SteadyStateRandomWaypointMobilityModel : public MobilityModel
|
||||
SteadyStateRandomWaypointMobilityModel();
|
||||
~SteadyStateRandomWaypointMobilityModel() override;
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<SteadyStateRandomWaypointMobilityModel>(*this);
|
||||
}
|
||||
|
||||
protected:
|
||||
void DoInitialize() override;
|
||||
|
||||
|
||||
@@ -89,6 +89,12 @@ class WaypointMobilityModel : public MobilityModel
|
||||
WaypointMobilityModel();
|
||||
~WaypointMobilityModel() override;
|
||||
|
||||
// Inherited from MobilityModel
|
||||
Ptr<MobilityModel> Copy() const override
|
||||
{
|
||||
return CreateObject<WaypointMobilityModel>(*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param waypoint waypoint to append to the object path.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user