solution_c Class Reference

This class stores the information for one solution for a problem. More...

#include <solution.h>

Collaboration diagram for solution_c:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 solution_c (assembly_c *assm, unsigned int assmNum, separation_c *t, unsigned int solNum)
 create a solution with a proper separation
 solution_c (assembly_c *assm, unsigned int assmNum, separationInfo_c *ti, unsigned int solNum)
 create a solution with only separation information
 solution_c (assembly_c *assm, unsigned int assmNum)
 creat a solution with assembly only, no disassembly
 solution_c (xmlParser_c &pars, unsigned int pieces, const gridType_c *gt)
 load a solution from file
 ~solution_c (void)
void save (xmlWriter_c &xml) const
 save the solution to the XML file
assembly_cgetAssembly (void)
 get the assembly from this solution, it will always be not NULL
const assembly_cgetAssembly (void) const
separation_cgetDisassembly (void)
 get the full disassembly or 0 if there is none
const separation_cgetDisassembly (void) const
disassembly_cgetDisassemblyInfo (void)
 get either the disassembly or the disassembly information or nothing
const disassembly_cgetDisassemblyInfo (void) const
unsigned int getAssemblyNumber (void) const
 get the assembly number
unsigned int getSolutionNumber (void) const
 get the solution number (0 if this solution has no disassembly
void removeDisassembly (void)
 remove an existing disassembly, and replace it by disassembly information
void setDisassembly (separation_c *sep)
 add a new disassembly to this solution, deleting an old one, in case such an old exists
void exchangeShape (unsigned int s1, unsigned int s2)
 change the solution so that shape s1 and s2 are swapped
void removePieces (unsigned int start, unsigned int count)
 remove count pieces starting with start from all information within this solution
void addNonPlacedPieces (unsigned int start, unsigned int count)
 add count not placed pieces starting at position start

Private Attributes

assembly_cassembly
separation_ctree
separationInfo_ctreeInfo
unsigned int assemblyNum
unsigned int solutionNum


Detailed Description

This class stores the information for one solution for a problem.

Constructor & Destructor Documentation

solution_c::solution_c ( assembly_c assm,
unsigned int  assmNum,
separation_c t,
unsigned int  solNum 
) [inline]

create a solution with a proper separation

solution_c::solution_c ( assembly_c assm,
unsigned int  assmNum,
separationInfo_c ti,
unsigned int  solNum 
) [inline]

create a solution with only separation information

solution_c::solution_c ( assembly_c assm,
unsigned int  assmNum 
) [inline]

creat a solution with assembly only, no disassembly

solution_c::solution_c ( xmlParser_c pars,
unsigned int  pieces,
const gridType_c gt 
)

solution_c::~solution_c ( void   ) 

References assembly, tree, and treeInfo.


Member Function Documentation

void solution_c::addNonPlacedPieces ( unsigned int  start,
unsigned int  count 
)

add count not placed pieces starting at position start

References separation_c::addNonPlacedPieces(), assembly_c::addNonPlacedPieces(), assembly, and tree.

void solution_c::exchangeShape ( unsigned int  s1,
unsigned int  s2 
)

change the solution so that shape s1 and s2 are swapped

References assembly, separation_c::exchangeShape(), assembly_c::exchangeShape(), and tree.

const assembly_c* solution_c::getAssembly ( void   )  const [inline]

References assembly.

assembly_c* solution_c::getAssembly ( void   )  [inline]

get the assembly from this solution, it will always be not NULL

References assembly.

Referenced by comp_3_pieces().

unsigned int solution_c::getAssemblyNumber ( void   )  const [inline]

get the assembly number

References assemblyNum.

Referenced by comp_0_assembly().

const separation_c* solution_c::getDisassembly ( void   )  const [inline]

References tree.

separation_c* solution_c::getDisassembly ( void   )  [inline]

get the full disassembly or 0 if there is none

References tree.

Referenced by solveThread_c::assembly().

const disassembly_c * solution_c::getDisassemblyInfo ( void   )  const

References tree, and treeInfo.

disassembly_c * solution_c::getDisassemblyInfo ( void   ) 

get either the disassembly or the disassembly information or nothing

References tree, and treeInfo.

Referenced by solveThread_c::assembly(), comp_1_level(), and comp_2_moves().

unsigned int solution_c::getSolutionNumber ( void   )  const [inline]

get the solution number (0 if this solution has no disassembly

References solutionNum.

void solution_c::removeDisassembly ( void   ) 

remove an existing disassembly, and replace it by disassembly information

References tree, and treeInfo.

void solution_c::removePieces ( unsigned int  start,
unsigned int  count 
)

remove count pieces starting with start from all information within this solution

References assembly, separation_c::removePieces(), assembly_c::removePieces(), and tree.

void solution_c::save ( xmlWriter_c xml  )  const

void solution_c::setDisassembly ( separation_c sep  ) 

add a new disassembly to this solution, deleting an old one, in case such an old exists

References tree, and treeInfo.


Member Data Documentation

unsigned int solution_c::assemblyNum [private]

Referenced by getAssemblyNumber(), save(), and solution_c().

unsigned int solution_c::solutionNum [private]

Referenced by getSolutionNumber(), save(), and solution_c().


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

Generated on Sun Oct 10 10:03:08 2010 for BurrTools by  doxygen 1.5.8