Opened 14 years ago
Last modified 14 years ago
#1309 closed defect
RealVectorAdditiveMoveWrapper is visible through the discovery mechanism — at Version 7
Reported by: | cneumuel | Owned by: | cneumuel |
---|---|---|---|
Priority: | medium | Milestone: | HeuristicLab 3.3.3 |
Component: | PluginInfrastructure | Version: | 3.3.3 |
Keywords: | Cc: |
Description (last modified by abeham)
HeuristicLab.Problems.TestFunctions.RealVectorAdditiveMoveWrapper is not a storable class. It should be one!
Update: I still think it should not be storable, but I removed the default constructor to prevent discovery.
Change History (7)
comment:1 Changed 14 years ago by abeham
comment:2 Changed 14 years ago by cneumuel
When configuring a MetaOptimization parameter tree, it can be a possible operator of a parameter. When this parameter configuration tree is stored, those possible operators also need to be stored.
comment:3 Changed 14 years ago by abeham
The RealVectorAdditiveMoveWrapper is not an operator. I don't know what you're doing, but you shouldn't use this data type in any way.
Here is the scope where it lives:
protected override double Evaluate(double quality, RealVector point, AdditiveMove move) { RealVectorAdditiveMoveWrapper wrapper = new RealVectorAdditiveMoveWrapper(move, point); return AckleyEvaluator.Apply(wrapper); }
It's not meant to be used in any other context.
comment:4 Changed 14 years ago by gkronber
I guess the problem is that RealVectorAdditiveMoveWrapper is a RealVector. Thus, automatic discovery of all possible values of a RealVector parameter also returns an instance of this class.
comment:5 Changed 14 years ago by abeham
How can I prevent such a discovery? Would it be enough to kill the default constructor (which doesn't make sense anyway) so that a default instance cannot be created?
comment:6 Changed 14 years ago by abeham
- Status changed from new to accepted
I will remove the default constructor.
comment:7 Changed 14 years ago by abeham
- Description modified (diff)
- Milestone changed from HeuristicLab x.x.x to HeuristicLab 3.3.3
- Owner changed from abeham to cneumuel
- Status changed from accepted to reviewing
- Summary changed from RealVectorAdditiveMoveWrapper is not storable to RealVectorAdditiveMoveWrapper is visible through the discovery mechanism
- Removed default constructor to prevent discovery
Please check if this solved your problem, otherwise we'll make it Storable.
Why?
It does not live beyond the scope of the move evaluator's apply method and will thus not get serialized.