Skip to content

Commit

Permalink
add SIMTIME_DELTA macro
Browse files Browse the repository at this point in the history
  • Loading branch information
aarizaq committed Feb 22, 2023
1 parent cef4a30 commit 15f58b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/inet/common/INETDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ extern INET_API OPP_THREAD_LOCAL int evFlags;
#define SIMULATION_SHARED_COUNTER(FIELD,...) \
getSimulationOrSharedDataManager()->getSharedCounter((std::string(opp_typename(typeid(*this)))+"::"+#FIELD).c_str(), ## __VA_ARGS__)

#define SIMTIME_DELTA SimTime(std::pow(10.0, SimTime().getScaleExp()))

} // namespace inet

#ifdef INET_WITH_SELFDOC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ bool Radio::isListeningPossible() const
const simtime_t now = simTime();
const Coord& position = antenna->getMobility()->getCurrentPosition();
// TODO use 2 * minInterferenceTime for lookahead? or maybe simply use 0 duration listening?
const IListening *listening = receiver->createListening(this, now, now + 1E-12, position, position);
const IListening *listening = receiver->createListening(this, now, now + SIMTIME_DELTA, position, position);
const IListeningDecision *listeningDecision = medium->listenOnMedium(this, listening);
bool isListeningPossible = listeningDecision->isListeningPossible();
delete listening;
Expand Down

0 comments on commit 15f58b9

Please sign in to comment.