public static void simulateRPU(LogicCircuit lc,GateLibrary gate_library,Args options){
  ArrayList<Gate> logic_and_output_gates=new ArrayList<Gate>();
  logic_and_output_gates.addAll(lc.get_logic_gates());
  logic_and_output_gates.addAll(lc.get_output_gates());
  for (  Gate gate : logic_and_output_gates) {
    gate.set_unvisited(true);
  }
  for (  Gate gate : logic_and_output_gates) {
    Evaluate.simulateRPU(gate,gate_library,options);
  }
}

public static void simulateRPU ( LogicCircuit lc , GateLibrary gate_library , Args options ) { ArrayList < Gate > logic_and_output_gates = new ArrayList < Gate > ( ) ; logic_and_output_gates . addAll ( lc . get_logic_gates ( ) ) ; logic_and_output_gates . addAll ( lc . get_output_gates ( ) ) ; for ( Gate gate : logic_and_output_gates ) { gate . set_unvisited ( true ) ; } for ( Gate gate : logic_and_output_gates ) { Evaluate . simulateRPU ( gate , gate_library , options ) ; } }
for all logic and output gates : set flag simulate_rpu = true ( indicates that rpu needs to be simulated ) then call simulaterpu ( ) in gate . java hill function evaluation
