fishkingsin / Archipelodio

0 stars 0 forks source link

sound playback system #19

Closed cedricmrdt closed 8 years ago

cedricmrdt commented 8 years ago

1. background sound

upon log in > play a random file from the database when file is over > random choose another one (no looping)

2. film dialogues: (2 systems ...final goal is the 2nd one)

global variables: -Time is discrete t= 0,1,2,3.... (so we can control the pace of the system)

at all time t and for each agent i=1,...k(t) there will be needed of these variables:

(these variables will be needed for nor or more complex implementation)

- Simple random playback (all have agents have same probability)

if at all time t, sum of active agents a_it = 0 then random choose an agent i for the pool.

if at all time t, the sum (over i) of the a_it is at most 1 then do nothing. (one dialogue at a time)

when sum(over i) of the a_it is equal to 0 again, choose random delay time (20sec to 3 min), then choose another agent to become active (play)

general remarks:

playback based on based on weighted probabilities:

procedure of creature weight for live agents (to favour or penalize agents)

(1) favour agents that have not been active for long time

wi = sum{j=0 to t} (1 - a_ij) (2**{j-t})

(2) favour agents that are close to active agents (if there is one). Use localisation / distance to the active users
A possibility is to fix a q (say 6) and to give weight 1 to the q closest neighbors and weight 0 to the others

procedure select_agent

this procedure chooses one agent (but it is allowed to choose none) in the set of "live" agents using a the weights in create_weights and the procedure "random". It is called if and only if the number of active agents is smaller than 2. Here is the pseudocode (for weights w1, …, wk)

   B[1] := w[1]
   for i = 2 … k do
        B[i] := B[i-1] + w[i]
   end for 
   x := random( )
   x := x * B[k]
   chosen := 0
   i := 1
   while chosen = 0 do
        if x <= B[i] then  chosen := i 
        else  i := i + 1
   end while 
   return chosen
fishkingsin commented 8 years ago

fixed with 2.1(1)