tesl
Class FilteredImplication<M extends java.lang.Comparable<? super M>,S extends java.lang.Comparable<? super S>>

java.lang.Object
  extended by tesl.ImplicationRelation
      extended by tesl.FilteredImplication<M,S>

public class FilteredImplication<M extends java.lang.Comparable<? super M>,S extends java.lang.Comparable<? super S>>
extends ImplicationRelation

A clock implication which creates ticks on the slave by filtering the ticks of the master clock according to a pattern.


Nested Class Summary
private  class FilteredImplication.FilteredImplicationBackup
           
 
Field Summary
private  int keep_
           
private  int phase_
           
private  int r_keep_
           
private  int r_skip_
           
private  int skip_
           
 
Fields inherited from class tesl.ImplicationRelation
applied_now_
 
Constructor Summary
FilteredImplication(Clock<M> master, Clock<S> slave, int skip, int keep, int repSkip, int repKeep)
          Get subClock by filtering master according to the pattern: - skip "skip" ticks - keep the next "keep" ticks - then, repeatedly skip repSkip ticks and keep repKeep ticks For instance, FilteredBy(m, s, 5, 1, 3, 2) will skip the first 5 ticks of "m", then keep its next tick for "s", then skip 3 ticks, keep 2 ticks, skip 3 ticks, keep 2 ticks and so on.
 
Method Summary
 ImplicationBackupInterface backup()
           
 Clock<M> getMasterClock()
          Return the master clock for the FilteredBy constraint
 boolean induceTicks()
          Determine whether a tick should be set "now" on the subclock slave clock.
 void restore(ImplicationBackupInterface bck)
           
 java.lang.String toString()
           
 
Methods inherited from class tesl.ImplicationRelation
apply, getMasterClocks, getSlaveClock, startSolving
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

skip_

private final int skip_

keep_

private final int keep_

r_skip_

private final int r_skip_

r_keep_

private final int r_keep_

phase_

private int phase_
Constructor Detail

FilteredImplication

public FilteredImplication(Clock<M> master,
                           Clock<S> slave,
                           int skip,
                           int keep,
                           int repSkip,
                           int repKeep)
Get subClock by filtering master according to the pattern: - skip "skip" ticks - keep the next "keep" ticks - then, repeatedly skip repSkip ticks and keep repKeep ticks For instance, FilteredBy(m, s, 5, 1, 3, 2) will skip the first 5 ticks of "m", then keep its next tick for "s", then skip 3 ticks, keep 2 ticks, skip 3 ticks, keep 2 ticks and so on.

Parameters:
master -
slave -
skip -
keep -
repSkip -
repKeep -
Method Detail

getMasterClock

public Clock<M> getMasterClock()
Return the master clock for the FilteredBy constraint


induceTicks

public boolean induceTicks()
Determine whether a tick should be set "now" on the subclock slave clock. Return true is the rule was applied (there is a now tick on the master clock).

Specified by:
induceTicks in class ImplicationRelation

toString

public java.lang.String toString()
Overrides:
toString in class ImplicationRelation

backup

public ImplicationBackupInterface backup()
Specified by:
backup in class ImplicationRelation

restore

public void restore(ImplicationBackupInterface bck)
Specified by:
restore in class ImplicationRelation