Public Types | Public Member Functions

opennwa::WeightGen Class Reference

This class is used in NWA::NWAtoPDS and NWA::NWAtoBackwardsPDS. More...

List of all members.

Public Types

enum  Kind {
  INTRA,
  CALL_TO_ENTRY,
  EXIT_TO_RET,
  CALL_TO_RET
}
typedef ref_ptr< ClientInfoClientInfoRefPtr

Public Member Functions

 WeightGen ()
virtual ~WeightGen ()
virtual sem_elem_t getOne () const =0
 access the One of the desired semiring
virtual sem_elem_t getWeight (Key src, ClientInfoRefPtr srcInfo, Key sym, Kind kind, Key tgt, ClientInfoRefPtr tgtInfo) const
 computes the weight(in the desired semiring) for a rule of the WPDS from the given edge
virtual sem_elem_t getExitWeight (Key src, ClientInfoRefPtr srcInfo) const
 computes the weight(in the desired semiring) for the return rule of the WPDS associated with the given exit
virtual sem_elem_t getWildWeight (Key src, ClientInfoRefPtr srcInfo, Key tgt, ClientInfoRefPtr tgtInfo) const
 computes the weight(in the desired semiring) for a rule when the symbol labeling the corresponding edge in the NWA is the wild symbol

Detailed Description

This class is used in NWA::NWAtoPDS and NWA::NWAtoBackwardsPDS.

It is used to compute the weights for the rules added to the WPDS and must be extended to incorporate the desired semiring in order to use either of these methods.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
INTRA 
CALL_TO_ENTRY 
EXIT_TO_RET 
CALL_TO_RET 

Constructor & Destructor Documentation

opennwa::WeightGen::WeightGen (  ) 
virtual opennwa::WeightGen::~WeightGen (  )  [virtual]

Member Function Documentation

virtual sem_elem_t opennwa::WeightGen::getOne (  )  const [pure virtual]
virtual sem_elem_t opennwa::WeightGen::getWeight ( Key  src,
ClientInfoRefPtr  srcInfo,
Key  sym,
Kind  kind,
Key  tgt,
ClientInfoRefPtr  tgtInfo 
) const [virtual]

computes the weight(in the desired semiring) for a rule of the WPDS from the given edge

This method computes the weight(in the desired semiring) for a WPDS rule from the (kind) edge between 'src' and 'tgt' labeled with symbol 'sym'. Note: The kind will never be CALL_TO_RET, this case is never needed.

Parameters:
- src: the source of the edge
- srcInfo: the clientInfo associated with src
- sym: the symbol labeling the edge
- kind: the variety of edge
- tgt: the target of the edge
- tgtInfo: the clientInfo associated with tgt
Returns:
the weight to put on the rule corresponding to the given edge

Reimplemented in opennwa::ShortestPathGen, and opennwa::ShortestWordGen.

References getOne().

Referenced by opennwa::Nwa::_private_NwaToBackwardsPdsCalls_(), opennwa::Nwa::_private_NwaToBackwardsPdsReturns_(), opennwa::Nwa::_private_NwaToPdsCalls_(), and opennwa::Nwa::_private_NwaToPdsReturns_().

virtual sem_elem_t opennwa::WeightGen::getExitWeight ( Key  src,
ClientInfoRefPtr  srcInfo 
) const [virtual]

computes the weight(in the desired semiring) for the return rule of the WPDS associated with the given exit

This method computes the weight(in the desired semiring) for the return rule of the WPDS corresponding to the exit 'src'. Note: This value is generally the same as getOne().

Parameters:
- src: the source of the exit edge
- srcInfo: the clientInfo associated with src
Returns:
the weight to put on the return rule corresponding to the given exit

Reimplemented in opennwa::ShortestPathGen, and opennwa::ShortestWordGen.

References getOne().

virtual sem_elem_t opennwa::WeightGen::getWildWeight ( Key  src,
ClientInfoRefPtr  srcInfo,
Key  tgt,
ClientInfoRefPtr  tgtInfo 
) const [virtual]

computes the weight(in the desired semiring) for a rule when the symbol labeling the corresponding edge in the NWA is the wild symbol

This method computes the weight(in the desired semiring) for a WPDS rule from the edge between 'src' and 'tgt' labeled with the wild symbol.

Parameters:
- src: the source of the edge
- srcInfo: the clientInfo associated with src
- tgt: the target of the edge
- tgtInfo: the clientInfo associated with tgt
Returns:
the weight to put on the rule corresponding to the given edge

Reimplemented in opennwa::ShortestPathGen, and opennwa::ShortestWordGen.

References getOne().

Referenced by opennwa::Nwa::_private_NwaToBackwardsPdsCalls_(), opennwa::Nwa::_private_NwaToBackwardsPdsReturns_(), opennwa::Nwa::_private_NwaToPdsCalls_(), and opennwa::Nwa::_private_NwaToPdsReturns_().


The documentation for this class was generated from the following file: