80 |
|
//////////////////////////////////////////////////////////////////////////////// |
81 |
|
//class RattleAlgorithm will encapsulate preConstraint, RattleA and RattleB |
82 |
|
//actually, we could use factory pattern to seperate the creation process |
83 |
< |
class RattleFramework : public ConsAlgoFramework{ |
83 |
> |
class RattleFramework : public VelVerletConsFramework{ |
84 |
|
public: |
85 |
< |
RattleFramework(SimInfo* rhs) : ConsAlgoFramework(rhs){ |
85 |
> |
RattleFramework(SimInfo* rhs) : VelVerletConsFramework(rhs){ |
86 |
|
raAlgo = new RattleA(rhs); |
87 |
|
rbAlgo = new RattleB(rhs); |
88 |
|
} |
92 |
|
delete rbAlgo; |
93 |
|
} |
94 |
|
|
95 |
< |
int doRattleA(){ |
95 |
> |
virtual int doConstrainA(){ |
96 |
|
raAlgo->doConstrain(); |
97 |
|
return raAlgo->haveError()? -1 : 1; |
98 |
|
|
99 |
|
} |
100 |
|
|
101 |
< |
int doRattleB(){ |
101 |
> |
virtual int doConstrainB(){ |
102 |
|
rbAlgo->doConstrain(); |
103 |
|
return rbAlgo->haveError()? -1 : 1; |
104 |
|
|