Java in Simulation Time: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
| Line 7: | Line 7: | ||
* All entity classes and related interfaces MUST be public. |
* All entity classes and related interfaces MUST be public. |
||
* The JUnit test runner is always restarted. Workaround: Write your own test runner using the pattern "setup - test - teardown". |
* The JUnit test runner is always restarted. Workaround: Write your own test runner using the pattern "setup - test - teardown". |
||
* Superclasses must be final. Otherwise the Rewriter generates invalid code (A java.verifier exception will occur). So a best practise is to mark all concrete classes as final to prevent this error. |
|||
=== Interesting Things === |
=== Interesting Things === |
||
Revision as of 14:03, 5 February 2006
Misc
Pitfalls
- Use Java 1.4 compatibility, BCel cannot handle Java 5.0
- If more than one node use the same NetAddress, the simulation aborts prematurely without any error message.
- All entity classes and related interfaces MUST be public.
- The JUnit test runner is always restarted. Workaround: Write your own test runner using the pattern "setup - test - teardown".
- Superclasses must be final. Otherwise the Rewriter generates invalid code (A java.verifier exception will occur). So a best practise is to mark all concrete classes as final to prevent this error.
Interesting Things
computeAvgConnectivity
Collisions
- RadioNoiseIndep and RadioSimpleStochastic both do not implement packet collisions on radio level:
RadioNoiseIndep.receive():
case Constants.RADIO_MODE_RECEIVING:
if(Main.ASSERT) Util.assertion(signals>0);
if(power_mW >= radioInfo.shared.threshold_mW
&& power_mW > signalPower_mW*thresholdSNR)
{
lockSignal(msg, power_mW, duration);
}
break;
- RadioNoiseAdditive implements additive superposition of radio signals and packet collisions. A signal is received only if it is stronger than thresholdSNR multiplied with the sum of the power of all other signals. Otherwise all signals are scrambled.
RadioNoiseAdditive.receive():
case Constants.RADIO_MODE_RECEIVING:
if(power_mW > signalPower_mW && power_mW >= totalPower_mW*thresholdSNR)
{
lockSignal(msg, power_mW, duration);
setMode(Constants.RADIO_MODE_RECEIVING);
}
else if(type == SNR
&& signalPower_mW < (totalPower_mW-signalPower_mW+power_mW)*thresholdSNR)
{
unlockSignal();
setMode(Constants.RADIO_MODE_SENSING);
}
break;
Multi-Channel Support for JiST
Architecture
RadioIf <|--- ChannelIf ---|> FieldIf
NetworkIf | MacIf <|-- Mac802_11 <|-- MacMc802_11 | | RadioIf | | | ChannelIf <|------------- Channel | FieldIf
- Channels are realized through an additional channel layer
- Has an active channel within a given set of channels
- Discards packets on other channels
- Delayed channel switching (only possible, when not transmitting)
- TODO Cross-channel interference