# Low RxQual causes upgrade of TCH/H to TCH/F, also when the cell is congested

network
 handover2 afs-bias rxlev 0
 handover2 min rxqual 5
 handover2 min rxlev -90
 handover2 window rxqual averaging 2
 handover2 min-free-slots tch/f 2
 handover2 min-free-slots tch/h 2

create-bts trx-count 1 timeslots c+s4 TCH/F TCH/F TCH/F TCH/H  TCH/H  PDCH PDCH

# This situation actually reduces congestion
set-ts-use trx 0 0 states        *    -     -     -     TCH/HH TCH/HH *    *
meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
# not enough values for rxqual averaging
expect-no-chan
meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
# average rxqual now at 6 which is worse than 5, reassign to TCH/F due to bad rxqual.
expect-as from lchan 0 0 4 0 to lchan 0 0 1 0
expect-ts-use trx 0 0 states     *    TCH/F -     -     TCH/-H TCH/HH *    *


# This situation actually balances congestion
set-ts-use trx 0 0 states        *    TCH/F -     -     TCH/HH TCH/HH *    *
meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
# not enough values for rxqual averaging
expect-no-chan
meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
# average rxqual now at 6 which is worse than 5, reassign to TCH/F due to bad rxqual.
expect-as from lchan 0 0 4 0 to lchan 0 0 2 0
expect-ts-use trx 0 0 states     *    TCH/F TCH/F -     TCH/-H TCH/HH *    *


# This situation moves congestion from TCH/H to TCH/F (TCH/H was 100% congested, then makes TCH/F 100% congested)
# The congestion requirements would normally forbid this, but since this is an "RxQual emergency", we should reassign.
set-ts-use trx 0 0 states        *    TCH/F TCH/F -     TCH/HH TCH/HH *    *
meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
# not enough values for rxqual averaging
expect-no-chan
meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
# average rxqual now at 6 which is worse than 5, reassign to TCH/F due to bad rxqual.
expect-as from lchan 0 0 4 0 to lchan 0 0 3 0
expect-ts-use trx 0 0 states     *    TCH/F TCH/F TCH/F TCH/-H TCH/HH *    *


# This situation worsens congestion (TCH/H was 50% congested, then makes TCH/F 100% congested)
# The congestion requirements would normally forbid this, but since this is an "RxQual emergency", we should reassign.
set-ts-use trx 0 0 states        *    TCH/F TCH/F -     TCH/H- TCH/HH *    *
meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
# not enough values for rxqual averaging
expect-no-chan
meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
# average rxqual now at 6 which is worse than 5, reassign to TCH/F due to bad rxqual.
expect-as from lchan 0 0 4 0 to lchan 0 0 3 0
expect-ts-use trx 0 0 states     *    TCH/F TCH/F TCH/F -      TCH/HH *    *


# This situation creates congestion (TCH/H was not congested, then makes TCH/F 50% congested)
# The congestion requirements would normally forbid this, but since this is an "RxQual emergency", we should reassign.
set-ts-use trx 0 0 states        *    TCH/F -     -     TCH/H- -      *    *
meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
# not enough values for rxqual averaging
expect-no-chan
meas-rep lchan 0 0 4 0 rxlev 50 rxqual 6 ta 0
# average rxqual now at 6 which is worse than 5, reassign to TCH/F due to bad rxqual.
expect-as from lchan 0 0 4 0 to lchan 0 0 2 0
expect-ts-use trx 0 0 states     *    TCH/F TCH/F -     -      -      *    *
