posted 18 years ago
hello, i'm stumped and hoping that someone can help me out...
i've created a class called IntState, which stores the state of a system
a second class Optimization performs an optimization algorithm on an original system state to find the state of optimum reliabilty... however, i'm having a major problem...
when executing the following (psuedo)code, the method makes changes to the currentState object as well as the state object, even though currentState is never modified, and is used only to supply a copy.
public IntState getNextState( IntState currentState )
IntState state = currentState.copy();
modify state
return state
anyone have any ideas??? i'm getting really desperate and would really appreciate it...
thanks in advance.
mike