Designing an Intelligent Controller for a Molecular Valve