xslides.el
//-*- Mode: JDE -tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- package biter; import java.util.Vector; /** * An agent-created event. These are usually "alarms" set to go off * after a certain time period. * * We can even put some math in here: $x^2 = \frac{1}{\alpha}$. * As such, this file cannot contain dollar signs. * * Let $\delta_i^t = \sum_{n=1}^k Pr[x=k_n]$ be $i$'s decision function at time $t$. * * * @author Jose M. Vidal * @version 1.0 * */ public class Event extends Input { /** The time when this event is scheduled to happen */ public long time; /** The name of this event */ public String name; Event (String name, long time){ this.time = time; this.name = name; this.realTime = System.currentTimeMillis(); } Event (Event e){ this.time = e.time; this.name = e.name; this.realTime = System.currentTimeMillis(); } /** Does this event happen before another one? * @param e the other event * @return true this.time < e.time */ public boolean isBefore (Event e){ return time < e.time; } public String toString(){ return "Event name: " + name + "\ntime: " + time + "\n"; } /** @param e the other event to compare to. @return true if both have the same name */ public boolean equals(Event e){ return name.equals(e.name); } }
10 of 28