Skip to main content
. 2023 Jan 5;23(2):639. doi: 10.3390/s23020639
Algorithm1 Recommender system algorithm represented in pseudocode
  • procedure Recommender system

  •      templatesdictionaryofsmartcontracttemplates

  •      fogTOSCAarchitecturerepresentedinTOSCAformat

  •      requirementslistofrequirements

  •      resultListresultlistofsmartcontracttemplates

  •      finishedfalse

  •      scoringfalse

  •     while finished=false||scoring=true do    ▹ while the results are not conflicting

  •          if scoring==true then

  •   ▹ Loop through the fogTOSCA components and vote (relationship, capability, type)

  •               if scoring results not equal then

  •                    return resultList and label conflicting templates

  •               end if

  •               if scoring results are equal then

  •                    return resultList and label conflicting templates

  •               end if

  •         end if

  •        while iterate through templates do ▹ filter each contract based on the requirements

  •                   ▹ if conflicting contract found set scoring = true

  •          end while

  •        while iterate through fogTOSCA do     ▹ for each component, add weight scores about relationship, capability and component type to potential templates

  •                      ▹ if conflicts still occur set scoring = true

  •           end while

  •      end while

  • end procedure