Optimization of an organic memristor as an adaptive memory element