예제 #1
0
def runDual(duration_mins):
    w = ps.Worm(dt, duration_steps, pir_window)
    p = ps.Plate()
    d_hist = np.zeros(duration_steps)
    inside = 0
    for step in range(duration_steps):
        w.step_rc()
        w.step_wv(p.conc(w.sx[0], w.sy[0]) - p.conc(w.sx[1], w.sy[1]))
        w.step_pr(step, p.conc(w.x, w.y))
        w.step()
        p.step(dt)
        if np.sqrt(w.x**2 + w.y**2) > p.petri_radius:
            w.bounce(p.petri_radius)
        d_hist[step] = dist(w, p)
        if d_hist[step] < p.CI_radial_radius:
            inside += 1
    outside = duration_steps - inside
    ci = (inside - outside) / duration_steps
    return d_hist, ci
예제 #2
0
def runDual(duration_mins):
    w = ps.Worm(dt, duration_steps, pir_window)
    w.x = 0.0
    p = ps.Plate()
    p.setGrid()
    p.noise_sd = 0.008
    x_hist = np.zeros(duration_steps)
    y_hist = np.zeros(duration_steps)
    for step in range(duration_steps):
        w.step_rc()
        #w.step_wv(p.conc(w.sx[0],w.sy[0])-p.conc(w.sx[1],w.sy[1]))
        #w.step_pr(step,p.conc(w.x,w.y))
        w.step()
        p.step(dt)
        if np.sqrt(w.x**2 + w.y**2) > p.petri_radius:
            w.bounce(p.petri_radius)
        x_hist[step] = w.x
        y_hist[step] = w.y
    return x_hist, y_hist
예제 #3
0
def runDual(steepness,duration_mins):
    w = ps.Worm(dt,duration_steps,pir_window)
    p = ps.Plate()
    p.setGrid()
    p.scale = steepness
    #p.noise_sd = noise
    d_hist = np.zeros(duration_steps)
    inside = 0
    for step in range(duration_steps):
        w.step_rc()
        #w.step_wv(p.conc(w.sx[0],w.sy[0])-p.conc(w.sx[1],w.sy[1]))
        w.step_pr(step,p.conc(w.x,w.y)) # v1.0
        #w.step_pr_v2(step,p.conc(w.x,w.y)) # v2.0
        w.step()
        p.step(dt)
        if np.sqrt(w.x**2 + w.y**2) > p.petri_radius:
            w.bounce(p.petri_radius)
        d_hist[step] = dist(w,p)
        if d_hist[step] < p.CI_radius:
            inside += 1
    outside = duration_steps - inside
    ci = (inside - outside)/duration_steps
    n=int(duration_mins/2)
    return np.mean(d_hist[-n:]),np.min(d_hist),ci