diff --git a/AlgebraicDataflowArchitectureModel/models/DataStore.model b/AlgebraicDataflowArchitectureModel/models/DataStore.model index 3ae99d1..b424034 100644 --- a/AlgebraicDataflowArchitectureModel/models/DataStore.model +++ b/AlgebraicDataflowArchitectureModel/models/DataStore.model @@ -1,37 +1,21 @@ -channel addAccounts { - out accounts(accounts: Map, addAccounts(id: Str, name: Str, age: Int)) = insert(accounts, id, {"name": name,"age": age}) +channel AddCompany { + out companies(comps: Map, addComp(compId: Str, compName: Str, compAdd: Str)) + = insert(comps, compId, {"name": compName, "address": compAdd}) } -channel changeNameOfAccounts(id: Str) { - out accounts.{id}.name(name: Str, changeNameOfAccounts(newName: Str)) = newName +channel AddCustomer { + out customers(custs: Map, addCust(custId: Str, custName: Str, cumpId: Str)) + = insert(custs, custId, {"name": custName, "company": cumpId}) } -channel changeAgeOfAccounts(id: Str) { - out accounts.{id}.age(age: Int, changeAgeOfAccounts(newAge: Int)) = newAge +channel SendCompName(custId: Str) { + in customers.{custId}.company(curCompId: Str, sendCompName(compId: Str, compName: Str)) = compId + in companies.{compId}.name(curName: Str, sendCompName(compId: Str, compName: Str)) = compName + out customers.{custId}.companyName(curName: Str, sendCompName(compId, compName)) = compName } -channel addTweets { - out tweets(tweets: Map, addTweets(tweetId: Int, contents: Str, idOfAccounts: Str)) = insert(tweets, tweetId, {"contents": contents,"idOfAccounts": idOfAccounts}) +channel SendCompAddress(custId: Str) { + in customers.{custId}.company(curCompId: Str, sendCompAddress(compId: Str, compName: Str)) = compId + in companies.{compId}.address(curName: Str, sendCompAddress(compId: Str, compName: Str)) = compName + out customers.{custId}.companyAddress(curName: Str, sendCompAddress(compId, compName)) = compName } - -channel changeContentsOfTweets(tweetId: Int) { - out tweets.{tweetId}.contents(contents: Str, changeContentsOfTweets(newContents: Str)) = newContents -} - -channel changeIdOfAccountsOfTweets(tweetId: Int) { - out tweets.{tweetId}.idOfAccounts(idOfAccounts: Str, changeIdOfAccountsOfTweets(newIdOfAccounts: Str)) = newIdOfAccounts -} - -channel nameOfAccountsOfTweets(tweetId: Int){ - in tweets.{tweetId}.idOfAccounts(idOfAccounts: Str, nameOfAccountsOfTweets(newIdOfAccounts: Str, newNameOfAccounts: Str)) = newIdOfAccounts - in accounts.{newIdOfAccounts}.name(name: Str, nameOfAccountsOfTweets(newIdOfAccounts, newNameOfAccounts)) = newNameOfAccounts - out tweets.{tweetId}.nameOfAccounts(nameOfAccounts, nameOfAccountsOfTweets(newIdOfAccounts, newNameOfAccounts)) = newNameOfAccounts -} - -channel ageOfAccountsOfTweets(tweetId: Int){ - in tweets.{tweetId}.idOfAccounts(idOfAccounts: Str, ageOfAccountsOfTweets(newIdOfAccounts: Str, newAgeOfAccounts: Int)) = newIdOfAccounts - in accounts.{newIdOfAccounts}.age(age: Int, ageOfAccountsOfTweets(newIdOfAccounts, newAgeOfAccounts)) = newAgeOfAccounts - out tweets.{tweetId}.ageOfAccounts(ageOfAccounts, ageOfAccountsOfTweets(newIdOfAccounts, newAgeOfAccounts)) = newAgeOfAccounts -} - - diff --git a/AlgebraicDataflowArchitectureModel/src/application/layouts/DAGLayout.java b/AlgebraicDataflowArchitectureModel/src/application/layouts/DAGLayout.java index 9200de6..a4d1ff1 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/layouts/DAGLayout.java +++ b/AlgebraicDataflowArchitectureModel/src/application/layouts/DAGLayout.java @@ -1,5 +1,13 @@ package application.layouts; +import com.mxgraph.layout.mxGraphLayout; +import com.mxgraph.model.mxCell; +import com.mxgraph.model.mxGeometry; +import com.mxgraph.model.mxIGraphModel; +import com.mxgraph.view.mxCellState; +import com.mxgraph.view.mxGraph; +import com.mxgraph.view.mxGraphView; + import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -9,14 +17,6 @@ import java.util.Set; import java.util.TreeMap; -import com.mxgraph.layout.mxGraphLayout; -import com.mxgraph.model.mxCell; -import com.mxgraph.model.mxGeometry; -import com.mxgraph.model.mxIGraphModel; -import com.mxgraph.view.mxCellState; -import com.mxgraph.view.mxGraph; -import com.mxgraph.view.mxGraphView; - public class DAGLayout extends mxGraphLayout { private mxIGraphModel graphModel; private mxGraphView view; @@ -147,7 +147,7 @@ boolean isVersion1 = true; - System.out.println(vertexToDepths); +// System.out.println(vertexToDepths); if (isVersion1) { layout1((mxCell) rootCell); } else {