Flexible modeling of all-optical processing and switching using SOAs