# config section
scenario = 5 # scenario selection
mode = 'bis' # rfc, bis or multicast

import sys
# scenario definitions
if scenario == 1:
    print 'Scenario: Enterprises in Different Industries'
    C1 = 8
    C2 = 3
    C3 = 4
    C4 = 2
    C5 = 40000
    C6 = 20000
    C7 = 100 
    C8 = 300
    C9 = 100
elif scenario == 2:
    print 'Scenario: Enterprises in the Same Industry'
    C1 = 8
    C2 = 3
    C3 = 20
    C4 = 10
    C5 = 40000
    C6 = 20000
    C7 = 100
    C8 = 300
    C9 = 100
elif scenario == 3:
    print 'Scenario: Medium-Sized Service Providers'
    C1 = 8
    C2 = 3
    C3 = 10
    C4 = 1
    C5 = 120000
    C6 = 60000
    C7 = 100
    C8 = 300
    C9 = 100
elif scenario == 4:
    print 'Scenario: Large Service Providers'
    C1 = 8
    C2 = 3
    C3 = 20
    C4 = 2
    C5 = 600000
    C6 = 300000
    C7 = 100
    C8 = 300
    C9 = 100
elif scenario == 5:
    print 'Scenario: Very Large Service Providers'
    C1 = 8
    C2 = 6
    C3 = 100
    C4 = 20
    C5 = 20000000
    C6 = 4000000
    C7 = 100
    C8 = 300
    C9 = 100
else:
    print 'unknown scenario'
    sys.exit(0)


# the modes calculate things a little differently
if mode == 'multicast':
    print 'multicast mode'
    # number of presence notifications or probes 
    # per remote domain
    C10 = 1 
    C11 = 1
    C7 += 200 # repeater wrapper overhead
    C8 += 200
    C9 += 200
elif mode == 'bis': # rock-hard optimizations
    print 'using bis optimizations'
    C10 = C3
    C11 = C4
else: # assume plain xmpp
    print 'rfc style xmpp'
    C10 = C3  
    C11 = C3

print

I1 = C10
I2 = C10 * C8
I3 = C10
I4 = C10 * C7
I5 = C4 
I6 = I5 * C8
I7 = I1 + I3 + I5
I8 = I2 + I4 + I6

S1 = (C1 * C2) - 2
S2 = S1 * C11
S3 = S2 * C8

T1 = C11
T2 = C11 * C9

B1 = I7 + S2 + T1
B2 = I8 + S3 + T2
B3 = B1 * C6
B4 = B2 * C6
B5 = B3 / (C1 * 3600)
B6 = B4 / (C1 * 3600)


###############################################################
print 'CONSTANTS'
print '(C1) Presence session lifetime (hours) .............', C1
print '(C2) Presence state changes per hour ...............', C2
print '(C3) Total federated contacts per user .............', C3
print '(C4) Number of online contacts per user ............', C4
print '(C5) Number of federated users .....................', C5
print '(C6) Number of online users ........................', C6
print '(C7) Size of presence probes .......................', C7
print '(C8) Size of presence notifications ................', C8
print '(C9) Size of unavailable presence notification .....', C9
print
print 'INITIAL STANZAS'
print '(I1) Number of outbound presence notifications .....', I1
print '(I2) Size of outbound presence notifications .......', I2
print '(I3) Number of presence probes per user ............', I3
print '(I4) Size of presence probes per user ..............', I4
print '(I5) Number of inbound presence notifications ......', I5
print '(I6) Size of inbound presence notifications ........', I6
print '(I7) Total number of initial stanzas ...............', I7
print '(I8) Total size of initial stanzas .................', I8
print
print 'STATE CHANGE STANZAS'
print '(S1) Number of state changes per user ..............', S1
print '(S2) Number of outbound presence notifications .....', S2
print '(S3) Size of outbound presence notifications .......', S3
print
print 'TERMINATION MESSAGES'
print '(T1) Number of unavailable presence notifications ..', T1
print '(T2) Size of unavailable presence notifications ....', T2
print
print 'BOTTOM LINE'
print '(B1) Number of stanzas per presence session ........', B1
print '(B2) Size of stanzas per presence session ..........', B2
print '(B3) Total number of stanzas exchanged .............', B3
print '(B4) Total size of stanzas exchanged ...............', B4
print '(B5) Total stanzas exchanged per second ............', B5
print '(B6) Total bytes exchanged per second ..............', B6
