Skip to content
Snippets Groups Projects
Select Git revision
  • d5eb2a6d4646800c7cc7753d7ee8549cedfde5fd
  • master default
  • dja
  • dja_fix_animations
  • dja_various_fixes
  • dja_differentiate_same_user_connections
  • dja_fix_bugs
  • dja_guest
  • dja_guests
  • dja_sign_out_without_race_conditions
  • dja_subgroups
  • dua_subgroups
  • dja_groups_2
  • dja_groups
  • dja_heroku_11_7_2024
  • dja_share_files
  • dja_execute_files_aux_2
  • dja_execute_files_aux
  • dja_execute_files
  • dja_files_page
  • dja-create-main-button
  • v2.0
  • v1.0
23 results

_tables.scss

Blame
  • channel.py 983 B
    import numpy as np
    import importlib
    import config
    importlib.reload(config)
    class Channel:
        def __init__(self, ChannelId, NumberNodes, Capacity, SlopeLin, SlopeSat):
            self.Capacity = Capacity
            self.SlopeLin = SlopeLin
            self.SlopeSat = SlopeSat
            self.ChannelId = ChannelId
            self.Linear = np.ones(config.SimulationTimeslots)
            self.NrUsers = np.zeros(config.SimulationTimeslots)
            self.AccessMatrix = np.zeros((NumberNodes,config.SimulationTimeslots))
        
        def channel_access(self,NodeId,Timestamp):
            if (Timestamp < config.SimulationTimeslots):
                self.AccessMatrix[NodeId,Timestamp] = 1
                self.NrUsers[Timestamp]+=1
                
        
        def update_state(self,Timestamp):
            if (Timestamp < config.SimulationTimeslots):
                if (self.NrUsers[Timestamp] < (self.Capacity / self.SlopeLin)):
                    self.Linear[Timestamp] = 1
                else:
                    self.Linear[Timestamp] = 0