设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12534|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! H# {. u. M$ e9 q4 J3 b+ A
  c' P3 p) I7 u( F( ~
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。1 |" A: U6 Y0 V: m
" M9 D/ a( s( R5 ~2 x1 a2 L
begin P_read arriving! N9 A- d* E: h/ ^/ l
    while 1=1 do begin% s% j7 R& Q6 [+ Y. ?' H+ G7 i# j
        read A_tote from "data.txt" with delimiter "\n". z0 N! W8 e0 @7 m1 L* R- k
        read A_time from "data.txt" with delimiter "\n"5 w7 o" R$ ]5 J; C" S
        read A_leave from "data.txt" with delimiter "\n". ?! o/ R6 r* u" n+ x0 x2 R# `9 T
        read A_picks from "data.txt" with delimiter "\n"3 Q' b9 w  r$ h4 |1 l  s
        set load type to A_tote
( T, q, h! X4 F  @- C. Y8 A        if A_tote="tote 1" then set A_induct to 1: g: e3 T) L4 x) `
        else if A_tote="tote 2" then set A_induct to 2
( F2 h( z, ]4 u+ q' h6 C9 H            else set A_induct to 3    & j3 K; Z  g6 W5 }- x8 [" c0 P. c/ s
        set A_i to 09 F3 H; A- z5 v9 b2 J
        clone 1 load to P_induction. y" N# s# `! x: |2 e$ w; m
        wait for A_time sec# ?: G: ?. C! j$ L! _
    end
. [% U  S' ?" D: q2 O" Z0 F% Mend2 Z& U  D3 ]/ ]" S9 k0 A

7 T, b; w& E! D  v( P, J# p* nbegin P_induction arriving
9 ~5 l" C( C2 m% R, y    if A_induct=1 then clone 1 load to P_pick1, c4 K! `  a9 `7 V  U8 K
    else if A_induct=2 then clone 1 load to P_pick2- Y5 k6 U! I- N( Y8 p, i) m
        else clone 1 load to P_pick34 P3 i( F6 N) [" P3 s; E
end
. b; T% P& K2 s' a1 {% L, Z6 B- [6 _
begin P_pick1 arriving! s- u0 m6 G0 j9 v. j  ~
    set A_i to 11 R7 v0 v' n- U  [# `' {* W) H) B
    move into Q_induct1% f0 \: s- {9 ?1 }! C
    move into pickaisle.induct1, E! l/ v) ~. Q, t! z( K* ^  E) W
    while A_i<=30 do begin
$ D% ?  k5 c/ ]# I        travel to pickaisle.con(A_i)
9 k4 `( b0 k/ W+ g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: T7 x" X: o$ T0 G4 l; T; @- Q
        else wait for 10 sec) j- _. J* L4 U3 S: Z( k2 ?
        if A_i=A_leave then send to die/ ?5 k" b4 ^/ \
        else inc A_i by 12 x. `% P  ]  E% h1 N: H
    end
$ P9 |; F4 F$ V& |end) E' n8 ]. _  j. Z
; i# q/ d/ H& {" E7 Y5 q7 t
begin P_pick2 arriving2 D) g9 n9 z$ c9 K7 P6 ~) t1 j0 k6 \
    set A_i to 11
, V, p- U/ D& m+ k9 X) W    move into Q_induct2
! w2 `9 G+ J9 Z) F    move into pickaisle.induct2
; D& ?4 ]& U2 [/ i, ]- e+ X: F    while A_i<=30 do begin
8 w0 |2 a5 P$ Y, w1 w. r1 v        travel to pickaisle.con(A_i)
* b. \* W& ]; H3 O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  O, k8 {2 x6 A1 y) w
        else wait for 10 sec
6 d6 U0 P. }7 L1 r9 N. v        if A_i=A_leave then send to die4 ~9 F2 T% G; ]" L/ R
        else inc A_i by 16 {- Z/ l- v! ]0 i
    end: c' b0 y" h* n( P6 r6 R# E
end# B& L, Y- |9 }
# H( J# W2 A7 [  C$ Q
begin P_pick3 arriving) u4 m; X) p5 o) W" p/ g! Q
    set A_i to 21
7 ?, ]/ a3 ?) Z    move into Q_induct39 T6 `2 X5 ^& f+ t
    move into pickaisle.induct3
* F2 e' R$ H. c: A  e2 n    while A_i<=30 do begin1 u. E+ J: g8 x! C
        travel to pickaisle.con(A_i)
' }' n, e  R4 `' |! [7 Z) N: I, J& r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 S) t/ J5 @. Q+ m        else wait for 10 sec
2 g8 @# q- i0 q( d  q- m        if A_i=A_leave then send to die
" g" @3 b8 v, Z! q8 a* Q9 M0 ^* K        else inc A_i by 1
( m* j; y8 ?1 ?  f% W* Q    end* u4 ]! V: P* |( B$ P
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
; B4 x+ O. C5 E) g9 R- Qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% v: c3 [( {+ d8 @1 k3 w* H

! t$ k0 F) s2 g  s) w, AAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. l* N8 q7 y: q" y0 q" z" j+ _* d0 C* z# M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
# R: W& [5 e' F1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) j9 |" {) z! B+ T6 d2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# o( X- G" \" M) C% {1 K8 _3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" Y4 _6 Y, @: V* V( Xbegin P_induction arriving
1 I$ c$ s: h# T0 c+ K' P    clone 1 load to P_pick(A_induct)+ C# @( o" j) ?& O) h4 m
end最大的系  Y7 u% ]0 P7 q
; k# X' _& x% g, u; W
begin P_pick arriving
; ?" R5 h& `9 p2 t    set A_i to procindex * 10 + 1$ Z5 r/ }+ |5 {' O( s: F  p4 y
    move into Q_induct(procindex)% @- q) _& h, g! d9 u3 `# w5 e- [
    move into pickaisle.induct(procindex)
* _$ F' ], V6 X7 @    /*check the type of pickaisle.induct(i), for your last problem.*/
2 `& l* T- v: r+ B
4 ]% ]3 Q, i+ y/ b7 G! ]8 [* n0 l    while A_i<=30 do begin8 ~% u3 G; @; V$ k: P5 E
        travel to pickaisle.con(A_i)
( X# J- G$ ], h/ a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 t& W- z( _1 o
        else wait for 10 sec, p) |; F% r0 @
        if A_i=A_leave then send to die' q) S& b! h& t6 ?
        else inc A_i by 1
0 Y+ B) s2 b! ~    end
1 T0 k: W9 o8 Q6 J. ]) send# Q/ M. |* U  F% y" K, L

6 X: H- N, p! U其中的procindex为整形,代表当前process的序号。4 \& e, [. T( |1 A7 B) n
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-1-30 13:51 , Processed in 0.016335 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表