[Tex/LaTex] Draw a path with a filled diamond at the beginning

tikz-pgf

My question is similar to this one, but I am trying to draw a simple black filled diamond at the beginning of a path, just like in the UML aggregate notation. Here is a minimal working example:

\documentclass{standalone}
\usepackage{tikz}

\usetikzlibrary{shapes, arrows, chains, decorations.markings,intersections,calc}

\begin{document}
    \begin{tikzpicture}
        \node (a) at (0,0) {a};
        \node (b) at (2,0) {b};
        \path (a.east) to node [near start, yshift=1em] {} (b.west); 
        \draw [<-,>=diamond] (a.east) -- (b.west);
    \end{tikzpicture}
\end{document}

but this produces a path with a diamond that has an arrow at the front, how do I get rid of the arrow?

E.g. turn <>----> into <>----

Update:

It seems I this behaviour is caused by the tikzset from this question, which I still had in my code. After removing it, I got the desired behaviour. So I change my question: What causes the arrow had to appear or disappear, and how can I change between both versions?

Update 2:
I have updated the question with a MWE and changed the explanation to avoid some of the confusion. The MWE actually produces the desired result of my original question and I am not able to reproduce the problem which I described in the cancelled text. Given all the confusion I think the actual question is this:

How can I produce each of the following UML variants for aggregation see here:

  • <>---- (this is produced by my MWE)
  • <>---> (arrow at right end)
  • <>---* (circle at right end)

Best Answer

You can make use of the arrows and arrows.meta libraries of TikZ. See section 16 in the TikZ Manual. Using this approach you can customize the length, width etc. of the arrow tips as well.

\documentclass[tikz,border=2pt]{standalone}
\usepackage{tikz}

\usetikzlibrary{arrows,arrows.meta}

\begin{document}
  \begin{tikzpicture}
    \node (a) at (0,0) {a};
    \node (b) at (2,0) {b};
    \draw [{Diamond}-] (a.east) -- (b.west);

    \begin{scope}[yshift=-1cm]
      \node (a) at (0,0) {a};
      \node (b) at (2,0) {b};
      \draw [{Diamond}-{Stealth}] (a.east) -- (b.west);
    \end{scope}

    \begin{scope}[yshift=-2cm]
      \node (a) at (0,0) {a};
      \node (b) at (2,0) {b};
      \draw [{Diamond}-{Circle}] (a.east) -- (b.west);
    \end{scope}
  \end{tikzpicture}
\end{document}

This gives the output

Output