

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object hu.birot.OTKit.performance.ProductionExamples
public class ProductionExamples
This class contains a number of static methods returning concrete implementations of the abstract class Production.
Constructor Summary  

ProductionExamples()

Method Summary  

static Production 
constant(Form F)
Creates a Production whose produce method always returns the form F. 
static Production 
grammatical()
This static method returns an instance of Production corresponding to the "produce some grammatical form" method. 
static Production 
SA(double K_max,
double K_step,
double t_max,
double t_min,
double t_step,
int nr_unmoved)
This static method returns an instance of Production that realizes a general simulated annealing. 
static Production 
SAOTnm(double K_max,
double K_step,
double t_max,
double t_min,
double t_step,
int nr_unmoved)
This static method returns an instance of the Production class, which implements the Simulated Annealing for Optimality Theory Algorithm. 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public ProductionExamples()
Method Detail 

public static Production grammatical()
This static method returns an instance of Production corresponding to the "produce some grammatical form" method. The produce(Grammar G, Form f) method of this Production will return a random surface form that is a grammatical (globally optimal) mapping from underlying form f, with respect to grammar G.
The set of candidates generated from underlying from f must be finite, as defined by method G.gen.allCandidates(f).
G.hierarchy.type defines how the candidates are compared. If the type is "hg", then the weights in G.hierarchy are employed. If the type is "ot", then G.hierarchy will be sorted by rank. In that case, if G.hierarchy contains constraints with equal ranks, then it is unpredictable how they will be ranked. (For this case, see grammaticalPermutte() and grammaticalStratified() below.)
public static Production SAOTnm(double K_max, double K_step, double t_max, double t_min, double t_step, int nr_unmoved)
This static method returns an instance of the Production class, which implements the Simulated Annealing for Optimality Theory Algorithm. The parameters of the cooling schedule in SAOT are given as the parameters of this method.
The produce(G, f) method of the returned Production stochastically maps an underlying form f to a surface form, using grammar G. Form f being the underlying form, the initial candidate of the random walk will be chosen randomly by G.gen.randomCandidate(f, Math.random()), the neighbourhood structure is given by G.topology, and G.hierarchy is used as the hierarchy defining the Harmony function. (Do not forget to specify whether G.hierarchy.type is "ot" or "hg".) If you would like to use different starting points for the random walk, you can change G.gen so that it implement a different firstCandidate(uf) method.
K_max
 Starting range of the temperature.K_step
 Step decreasing the range of the temperature.t_max
 Highest value of the temperature in each range.t_min
 Step decreasing the value of the temperature within a range.t_step
 Lowest value of the temperature in each range.nr_unmoved
 Number of iterations during which the random walker has not
moved in order to stop.
public static Production SA(double K_max, double K_step, double t_max, double t_min, double t_step, int nr_unmoved)
This static method returns an instance of Production that realizes a general simulated annealing. The method produce(Grammar G, Form f) will return a surface form with respect to Grammar G and underlying form f. The production method used is:
In both cases, G.hierarchy.type are rewritten: to "ot" in the first case and to "hg" in the second case.
In the SAOT case, the parameters of SAOT are those specified as the parameters of this static method.
In the traditional SA (SAHG) case, q is either 2 (if G.type == "hg"), or the real value specified by prefix of G.type up till the first "" character. (For instance, if G.type == "3.13HG", then q == 3.14.) Subsequently, the SAOT parameters are converted to corresponding parameters Tmax and r of traditional exponential SA (where temperature is decreased from Tmax by a multiplicative factor q in each iteration). The following formulae are employed:
Both in OT and in HG, the random walk is launched from G.gen.randomCandidate(f, Math.random()). The neighborhood structure is defined by G.topology. The random walk terminates if the random walker has not moved for nr_unmoved iterations.
K_max
 K_step
 t_max
 t_min
 t_step
 nr_unmoved

public static Production constant(Form F)
F
 the Form that will be constantly returned by the produce method of the Production.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 