Comments (11)
Hi @R0B1NNN1, thanks for the insights π
mobile-env loads some of its core components and their configuration at runtime from the config
dictionary (see here for an example from the documentation), including the Channel
class, i.e., you could passconfig['channel'] = SINRChannel
when creating the environment.
I believe changing the interface of the Channel
class is thus all what is needed to enable a SINR
based calculation. I'll look into this during the weekend π
from mobile-env.
Hi @R0B1NNN1 , at the moment mobile-env cannot handle the additional arguments, that's why I'll be changing the interface.
I just intended to outline how it would work once I completed the PR π
from mobile-env.
Hi @R0B1NNN1, I've checked the implementation of mobile-env and getting a SINR
based channel to work is more complicated than I initially thought.
I believe your implementation above is erroneous, since you calculate the interference based on the overall transmission power of a base station, although an idle base station (i.e., not connected to any user) would not send at all. I believe, you should calculate the interference terms based on the actual power that each base station emits instead.
The issue also gets more complicated through our implemented of a scheduler that reallocates channel resources at the base stations. Since the interference term changes as a non-linear function of the allocated transmission power and also changes based on the assignment to other user equipments, the way we do scheduling as of now, doesn't work out.
I believe this could also be a slight bug in the current implementation @stefanbschneider. At the moment, we calculate the channel capacities in terms of the max. available data rate between UEs and BSs and then reschedule these, assuming that such an assignment exists. Since the power loss is also a non-linear function, this is, however, not necessarily the case.
Instead of using data rates as a basis of scheduling, I believe, we should use the underlying resource (i.e., transmission power) of a base station to compute the assignment. The scheduler then computes what transmission power to assign to each user equipment based on the data rate it would receive. The scheduler thus needs a) the resources available at each base station, b) a channel model that it uses to compute the data rates for a resource assignment, c) an optimization algorithm or heuristic that finds a rate-fair, min-max, ... allocation. Of course, this would be a bit more complex that our implementation thus far.
So, I think we need to do the following things:
- Compute the assignment of channel resources based on the actual resource of the base stations (i.e., transmission power, phy. resource blocks, ...). Once we updated what connections are established based on the agent's actions, we use the scheduler to compute the allocation.
- Change the
Channel
class to aWirelessMedium
class that calculates the data rates (or some other measurement) based on such an assignment of resources for each UE instead of single [BS, UE] connections.
What do you think @stefanbschneider?
from mobile-env.
Thanks for replying. It does help. I think maybe I will not focus on the interference for now. As you said
You'd only have to model interference if the same resource blocks are reused within a cell (or across neighboring cells).
So maybe we could close these issues. And if I have some other questions, I can open a new issue to discuss.
from mobile-env.
@stefanbschneider @stwerner97
Hi, regarding my own question (custom SINR calculation), I think the best way is changing from the source code, I downloaded the source code and made the following changes in 'mobile_env.core.channels'
class Channel:
def __init__(self, **kwargs):
pass
def reset(self) -> None:
pass
@abstractmethod
def power_loss(self, bs: BaseStation, ue: UserEquipment) -> float:
"""Calculate power loss for transmission between BS and UE."""
pass
def snr(self, bs: BaseStation, ue: UserEquipment, all_bs: List[BaseStation]):
"""Calculate SINR for transmission between BS and UE."""
signal_power = 10 ** ((bs.tx_power - self.power_loss(bs, ue)) / 10)
interference = sum(
10 ** ((b.tx_power - self.power_loss(b, ue)) / 10)
for b in all_bs
if b != bs
)
return signal_power / (ue.noise + interference)
Inside the code, I did not change the name "snr" to "sinr" since if I do that, I have to change everywhere else to "sinr", just want to mention this point. And this works. But I am still wondering is there any way to overwrite the old SNR? since I want to use import mobile_env
directly instead of downloading the source code and made few changes.
Now I think the only problem is how to deal with the extra argument when you overwrite the old functions. I don't think you can implement SINR with only two arguments bs
and ue
when you try to overwrite.
It might be easy, but I am really poor in coding.
Thanks for replying in advance.
from mobile-env.
@stwerner97 I failed to overwrite the old SNR
with SINR
. It seems like I cannot deal with the extra arguments since I mentioned before, I do not think by using arguments bs
and ue
are enough to implement SINR
. And also, as you mentioned " you could pass config['channel'] = SINRChannel
creating the environment." If we do this, how can we deal with the extra argument, since inside the source code mobile_env.core.base
file, there are loads of places are using SNR
.
Thanks for replying in advance.
from mobile-env.
Sure, thanks for replying, I am looking forward to the new version. π
from mobile-env.
@stwerner97, thanks for replying. Yes, I found my implementation above is erroneous. And I definitely agree with
Instead of using the data rates as a basis for scheduling, I believe, we should use the underlying resource (i.e., transmission power) of a base station to compute the assignment.
I am looking at all of the source code for mobile-env
to see if I can change something which will make the whole environment more in line with cellular networks.
Thanks for replying and sharing your thoughts. I am looking forward to the future version of mobile-env
.
from mobile-env.
@stwerner97 My original assumption for the environment (that I implemented within DeepCoMP) was that all cells have the same transmission power and scheduling does, like you suggested, happen based on resource blocks that are shared between the connected UEs. As a result, these resources could be shared resource-fair, rate-fair, proportional-fair, or other: https://github.com/CN-UPB/DeepCoMP/blob/master/docs/model.md
I thought we had something similar implemented in mobile-env too: https://github.com/stefanbschneider/mobile-env/blob/main/mobile_env/core/schedules.py However, I do see that the argument is called rates
, so not sure what happens in detail.
In general, I'm happy when people use mobile-env and try to maintain it by answering questions, fixing bugs or updating dependencies. Unfortunately, I don't have the time for larger refactoring or implementing new features.
Clearly, others are very much welcome to implement new features and contribute them back to mobile-env :)
Not sure about your capacity/time that you can/want to invest @stwerner97 ?
from mobile-env.
Sorry for taking so long to respond @stefanbschneider! π
Looking at the data_rate_shared()
method in the station.py file of DeepCoMP, the data rate assigned to a user equipment is computed based on its max. achievable data rate (without other users competing for the same base station). In case of the resource-fair
sharing model, for example, the estimate is then divided by the number of connected users, so the above mentioned issue also applies, no?
Same for me, I've been quite busy, but if there is indeed an issue with the resource scheduling, I would be happy to fix it, although this could take a while.
from mobile-env.
@stwerner97 No worries :)
If we have a fixed TX power (current assumption), doesn't resource-fair sharing mean that all users get the same amount of resource blocks (RBs) (time/frequency), i.e., 1/num_users
of all RBs.
And shouldn't the achievable data rate scale linearly with the amount of scheduled RBs for an individual user?
That's how the resource-fair sharing is currently computed.
Note that we assume there is no interference:
- BS assign different resource blocks (RB) to different UEs (different time or frequency). Hence, there is no interference between UEs at the same BS.
- Neighboring BS do not use the same RBs but have slightly shifted frequencies. Hence, there is no cinterference between BSs.
@R0B1NNN1 Not sure if this reasoning also makes sense to you? You'd only have to model interference if the same resource blocks are reused within a cell (or across neighboring cells).
I think this would make the whole computation a lot more complicated since you'd have to model RBs explicitly (which we currently don't in mobile-env) and you'd have to calculate the interference separately.
from mobile-env.
Related Issues (16)
- Collect and write metrics for evaluation HOT 8
- Thank you & Using NS3 or OMNeT++? HOT 3
- Allocate Physical Cell Identifier (PCI) to BS HOT 4
- Can this implement ue to ue connection? HOT 1
- Feature Request: migrate from gym to gymnasium HOT 4
- Link mobile-env paper
- Refactor environment to wrappers for multi-agent and central setting
- Update to stable-baselines3 v2.0+ HOT 2
- Add separate Ray RLlib example HOT 2
- Update readme from Gym to Gymnasium HOT 1
- Action space definition HOT 7
- RLlib resource error in demo notebook HOT 15
- Limit mobile-env to single-cell selection HOT 8
- For custom env HOT 4
- env.load() halts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobile-env.