You can set the value of a member including associations with something like this:
child1.getMendixObject().setValue(getContext(), child1.proxies.parent.MemberNames.child_parent.toString(), parent.getMendixObject().getId());
From the proxy object you first get the IMendixObject, then set the value using the child proxy object to get the specific member (the association between child and parent) and then set the value. This is a method that is not hardcoded in the sense that the action will break on the compilation of the project if the chid_parent association is changed or deleted.
The setter is on the child. I just didn't see it