Match wrong road

Hi,I’m a beginner to learn map-matching, and I use this map-matching, most of results are very good, thanks for your effort.But there is something confused me. I want to match the origin gpx data with motorway with high priority, I’ve tried to create a weighting extends FatestWeighting to change their weights, but it doesn’t matter. So can you tell me how to compile this function. Thanks in advance.By the way,I set 1000 with the accracy in the web.

pic1