A tristable locally-active memristor and its complex dynamics