设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12486|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 G7 p. x( Q$ P& {7 Q# c) V9 l3 v) c; f2 Y, M0 G* y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" L! W( _+ r7 @' w1 c, t. [) }

% O9 Q* A/ ?; a$ q; c: F. Lbegin P_read arriving
/ L4 t- [$ T5 p1 l    while 1=1 do begin
2 L3 O8 h" j; l9 A5 N; h5 f        read A_tote from "data.txt" with delimiter "\n"
. w% ]$ O$ t, E' k3 P& j        read A_time from "data.txt" with delimiter "\n"
+ l2 T6 u/ l% A, K5 M2 \6 @        read A_leave from "data.txt" with delimiter "\n"
( P- @; a  ~& [; u/ O" m& L        read A_picks from "data.txt" with delimiter "\n"9 m% f0 P/ j* W; t% M0 D+ |
        set load type to A_tote0 y: S7 G7 z* \% \: o
        if A_tote="tote 1" then set A_induct to 1
) H; `9 c1 G9 _; W0 D' _( a, v; ]" C        else if A_tote="tote 2" then set A_induct to 2$ p% ]$ H+ d4 @$ ~9 v  J) i& ~
            else set A_induct to 3    3 Z& M% S) }+ C
        set A_i to 0, O* j9 u5 D+ d: A5 M) R5 L' ?7 `
        clone 1 load to P_induction
! U. k# N) H; U( n1 w: q& p) i        wait for A_time sec$ i! M+ N; F! B* P
    end
* O3 G9 O% k% G: b8 y6 ?end/ Z+ t! I% r! k  M8 E- T
" i) S7 {% B+ y% y+ r8 R
begin P_induction arriving  F: J. q8 T9 L
    if A_induct=1 then clone 1 load to P_pick1
3 j4 `+ c+ X0 p  X7 H# O3 W, o    else if A_induct=2 then clone 1 load to P_pick2
; P: m5 O$ w9 g0 A. `- @. O" @        else clone 1 load to P_pick3
, }; b! Q+ n. Q" U! Lend
3 J# X% c$ f. q% s# \1 X' _& T: X
( {3 [8 z5 y& J3 Hbegin P_pick1 arriving
( [' Y$ y  T- c    set A_i to 17 Q3 S. q% }& t& w) X
    move into Q_induct10 T$ }* H& p/ [9 N/ O0 g3 C
    move into pickaisle.induct1
  S2 u2 a) v& t    while A_i<=30 do begin
% d1 K! i5 p) T! i' E  |        travel to pickaisle.con(A_i)
6 U$ P6 i7 b: E- H1 [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' F% B) b+ x  C6 J        else wait for 10 sec
( ^& N2 q6 H% \' n" [        if A_i=A_leave then send to die# r' y  ?* z1 y3 I5 [+ E8 N" u5 z
        else inc A_i by 1
8 I8 L+ L) A7 `7 y/ g/ p    end
# B/ [; N' l$ cend
# w5 }/ m% q7 X6 t0 X/ A2 F* w$ l3 `) u, B7 D
begin P_pick2 arriving1 O; L" L! ~9 F# W" S
    set A_i to 11- Y" c3 x, A5 G8 f8 d
    move into Q_induct2
, |" i- c6 D6 E  q* L  N    move into pickaisle.induct2
9 ~3 M8 Q, u  \; }$ V6 d& p    while A_i<=30 do begin
+ j4 Z! A) k, i" l8 [" }        travel to pickaisle.con(A_i)
- m& D. y$ V7 [; m/ z) t# P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 V0 ?  }0 Q" Z. z5 Q$ T
        else wait for 10 sec
$ X7 V9 M! j! `1 y) n        if A_i=A_leave then send to die
4 t+ A/ K# o5 [4 }        else inc A_i by 1
0 s& R' P" ~" V1 s! A    end; [7 P4 d0 Q7 V
end5 M0 X( h, x7 u, h% J) a
' f; i( `6 [, O$ P; _  W
begin P_pick3 arriving
) |5 y& H  o" Z0 y+ Q6 M    set A_i to 21
! x2 J0 L# @9 S" z. U2 D5 K    move into Q_induct3- v$ _0 B$ ]* h# |
    move into pickaisle.induct3
* \) m& l* T+ S0 \1 `! [4 i    while A_i<=30 do begin
" _. x0 z3 K: ]4 n0 H7 q        travel to pickaisle.con(A_i)2 H+ k5 Q% m/ u8 N& C- y/ Z$ o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 q" A9 U- @6 s" n, O: Q/ q; `
        else wait for 10 sec
; V1 b9 T8 U( }4 ?+ f$ P        if A_i=A_leave then send to die2 Q* r' N6 L0 L+ @  Z. G2 z
        else inc A_i by 1
* \2 C9 I6 J3 ?7 U    end
" \1 P2 f" O5 |; N8 wend

最佳答案

查看完整内容

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是个什么东东?
# q( h/ G0 _. {, E1 R7 A# Ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ V) `: k8 n' i* ?
: m$ F& t+ D: i9 u
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% n3 d6 j; \* r5 w" m
& s/ h+ V2 s9 Z4 m另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. [+ o3 b) x1 f* N/ m) K
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ o5 ^, G3 L+ ^5 R8 s& O
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  h5 S1 ]" s7 b/ Z! F: `
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ w1 `- n. ~3 d/ Q
begin P_induction arriving
- H8 F" m, }/ x# z3 p' y# m    clone 1 load to P_pick(A_induct)
5 c" |+ s$ f3 D3 ]9 O5 h2 d0 ~end最大的系
7 w/ R8 V( K& P' ~8 Y% e& u2 C% [/ I- q5 Q
begin P_pick arriving
5 W% N- D1 x, e    set A_i to procindex * 10 + 1" j% W" @+ K6 U
    move into Q_induct(procindex)' K7 w  [# y/ B1 J9 t
    move into pickaisle.induct(procindex)
& P$ o4 H: W' ^2 |" A5 |    /*check the type of pickaisle.induct(i), for your last problem.*/: r1 L" A, R; I3 Q" c' N9 [8 }# J

# Q$ \9 z6 Y, \5 {6 |4 ]$ _    while A_i<=30 do begin
9 g# ~; M& L6 c  m: U. o5 ?- F        travel to pickaisle.con(A_i)
* V% {& ~7 b: N% r6 A! T5 j$ V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# K4 j: p$ T: _9 m        else wait for 10 sec
" X) C3 V) s# C* T& k$ L3 W        if A_i=A_leave then send to die- O6 A' R1 l& o: c4 v3 u
        else inc A_i by 1* `; p3 \9 f  S/ q6 N
    end; d5 l, Y! N8 J4 ]
end4 U3 S* k7 o) J

8 g* I4 a7 y" Z6 {4 G2 e  D0 v其中的procindex为整形,代表当前process的序号。, i# S% C) \4 C: s& {# v
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-28 11:58 , Processed in 0.018907 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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