Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ifs.extension
Class Assignment

    java.lang.Object
      ifs.extension.Assignment

    public class Assignment

extends Object

This class describing an assignment of a value to a variable together with a counter (used by CBS). Counter also supports ageing: the counter is multiplied by aging factor for each iteration.

Version:
  1.0
Author:
  Tomáš Müller

Nested Class Summary
`static class` | `Assignment.AssignmentComparator` Assignment comparator

Constructor Summary
`Assignment(long iteration, Value value, double ageing)` Constructor

Method Summary
`static int` | `combine(int a, int b)` Combine two integers (for hash code)
`int` | `compareTo(long iteration, Assignment a)` Compare two assignments (their counters)
`boolean` | `equals(Object o)`
`static Comparator` | `getComparator(long iteration)` Returns comparator of assignments
`double` | `getCounter(long iteration)` Get counter
`Value` | `getValue()` Returns value
`int` | `hashCode()`
`void` | `incCounter(long iteration)` Increments counter
`void` | `revise(long iteration)` Revise counter.
`void` | `setCounter(double cnt)` Set counter
`String` | `toString()` String representation
`String` | `toString(long iteration, boolean assignment)` String representation (e.g., 10x A := a)

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Assignment

    public Assignment(long iteration,
                      Value value,
                      double ageing)

  Constructor

  Parameters:
    `iteration` - current iteration
    `value` - value
    `ageing` - ageing factor

Method Detail

### getValue

    public Value getValue()

  Returns value

### incCounter

    public void incCounter(long iteration)

  Increments counter

  Parameters:
    `iteration` - current iteration

### setCounter

    public void setCounter(double cnt)

  Set counter

  Parameters:
    `cnt` - new value

### getCounter

    public double getCounter(long iteration)

  Get counter

  Parameters:
    `iteration` - current iteration

### revise

    public void revise(long iteration)

  Revise counter. If ageing is used, counter is adopted to the current iteration: it is multiplited by ageing factor powered by the number of iterations since last revision.

### combine

    public static int combine(int a,
                              int b)

  Combine two integers (for hash code)

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### equals

    public boolean equals(Object o)

  Overrides:
    `equals` in class `Object`

### getComparator

    public static Comparator getComparator(long iteration)

  Returns comparator of assignments

### toString

    public String toString()

  String representation

  Overrides:
    `toString` in class `Object`

### toString

    public String toString(long iteration,
                           boolean assignment)

  String representation (e.g., 10x A := a)

### compareTo

    public int compareTo(long iteration,
                         Assignment a)

  Compare two assignments (their counters)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 Tomáš Müller