Search in sources :

Example 1 with CompositeSoftNode

use of EAnalysis.BinPacking.CompositeSoftNode in project osate2 by osate.

the class Binpack method getThreadBindings.

private Map getThreadBindings(final Set hardware) {
    final Map threadsToProc = new HashMap();
    for (Iterator iter = hardware.iterator(); iter.hasNext(); ) {
        HardwareNode n = (HardwareNode) iter.next();
        for (Iterator taskSet = n.getTaskSet().iterator(); taskSet.hasNext(); ) {
            SoftwareNode m = (SoftwareNode) taskSet.next();
            if (m instanceof CompositeSoftNode) {
                final Set set = ((CompositeSoftNode) m).getBasicComponents();
                for (Iterator software = set.iterator(); software.hasNext(); ) {
                    final SoftwareNode sn = (SoftwareNode) software.next();
                    threadsToProc.put(sn.getSemanticObject(), n.getSemanticObject());
                }
            } else {
                if (!(m instanceof Message)) {
                    threadsToProc.put(m.getSemanticObject(), n.getSemanticObject());
                }
            }
        }
    }
    return threadsToProc;
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) Message(EAnalysis.BinPacking.Message) HashMap(java.util.HashMap) SoftwareNode(EAnalysis.BinPacking.SoftwareNode) CompositeSoftNode(EAnalysis.BinPacking.CompositeSoftNode) Iterator(java.util.Iterator) HardwareNode(EAnalysis.BinPacking.HardwareNode) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

CompositeSoftNode (EAnalysis.BinPacking.CompositeSoftNode)1 HardwareNode (EAnalysis.BinPacking.HardwareNode)1 Message (EAnalysis.BinPacking.Message)1 SoftwareNode (EAnalysis.BinPacking.SoftwareNode)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1 Set (java.util.Set)1