设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15006|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: X3 s  G7 i3 X; Y* |* Z: `& E4 l5 W- {/ H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! Q6 v- Z1 q9 }9 T. I; ~
5 S. m  n2 h1 y! X8 y# Nbegin P_read arriving0 x6 O# i8 }) R
    while 1=1 do begin6 I% S4 |- f9 w! x; ~$ k! M
        read A_tote from "data.txt" with delimiter "\n"
% ?8 O) W! H% I6 l& J# y        read A_time from "data.txt" with delimiter "\n"
, S" d; P3 B' N# t9 d' A2 ^$ N2 ^        read A_leave from "data.txt" with delimiter "\n"6 j/ |5 k$ S' s1 G9 t2 z2 h5 v4 i
        read A_picks from "data.txt" with delimiter "\n"$ F2 N& S- v) i  e+ T' P, d6 |
        set load type to A_tote
) a& Z0 j6 [8 [3 z/ l* o8 s- L        if A_tote="tote 1" then set A_induct to 1
8 \" _; Y: ~# n2 U  I1 B5 X7 u        else if A_tote="tote 2" then set A_induct to 2
) Q# {8 f. V' o, h- a& q            else set A_induct to 3    8 H" A2 t+ m+ F6 g( e, ]: R6 u4 R
        set A_i to 0
* b9 E5 t0 h% N6 s! ^: m' a/ }        clone 1 load to P_induction3 k( C$ Z) I" m# q: G: Z& n
        wait for A_time sec
! j  C: P9 u9 j  d    end/ o7 X! s5 a5 u4 {
end
8 t( E3 e9 t: d/ B( R- p" \3 Q$ e) Q% R) H
begin P_induction arriving
0 t) P! s. P2 T' c" a    if A_induct=1 then clone 1 load to P_pick1( i8 j& J* V5 M" N2 ?) P  Y
    else if A_induct=2 then clone 1 load to P_pick28 S2 V# ~3 f/ ?0 _2 @% J9 x' U
        else clone 1 load to P_pick3
+ i0 g( h, e" S" b& kend8 l9 g$ }4 C# V* h% A

8 e' m; c. P5 n, |& V+ h3 a) Nbegin P_pick1 arriving
2 ~: G  p5 M6 m    set A_i to 15 u' j* I8 G, h9 k6 k. l
    move into Q_induct1
" a# N- w7 N5 A8 \+ E0 Y* @    move into pickaisle.induct18 h. A" v' d! d. o. I1 Q( o' @
    while A_i<=30 do begin
! h1 n$ b/ K3 E% E        travel to pickaisle.con(A_i)2 Z3 A' _5 D$ `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# n; [' J8 ~6 K  i) n# n4 v        else wait for 10 sec
( j: W0 B, A4 O; {" y        if A_i=A_leave then send to die! z4 D$ e! L; ^& `& n( }! }, ~
        else inc A_i by 1% W; y7 d$ w- m- Z! J
    end
1 G/ i9 ?) c/ |, H7 w- Iend9 n3 C! V5 S0 F  R- s

  U9 u8 R7 j$ Y" e& y) v/ V( Nbegin P_pick2 arriving8 W8 H  f5 d: L3 ]
    set A_i to 11
. r2 W! }( V: Q0 Q1 b) z* H    move into Q_induct2( o. _8 L2 y" O, h/ O2 M8 q6 k
    move into pickaisle.induct2% ]2 a2 w% p! ]4 H4 }1 [5 L
    while A_i<=30 do begin
8 ^) c4 C3 m0 `' _" N        travel to pickaisle.con(A_i)
/ h* {- g+ A$ E1 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ N2 b8 Y5 d/ c( L2 i4 \) G- n
        else wait for 10 sec' f+ S# n; }' l" N, j
        if A_i=A_leave then send to die( z0 _, O+ `1 O% G# y
        else inc A_i by 1
% B+ c, \- G/ q3 ]  Q    end, r5 w! |4 U# A7 L/ f( k
end
+ S6 s6 l* {% P6 w9 E3 e# L" I' e% O. y0 }' n6 h  L) @1 a# `
begin P_pick3 arriving
: q7 Q$ F( Z$ m8 i5 K5 a5 W    set A_i to 21
' }4 T' f& e' w6 L1 p2 ]# y    move into Q_induct3
" s. a. Y6 n$ K* X# d: {2 U    move into pickaisle.induct3
- \/ m8 Y, ]/ Z! w8 b    while A_i<=30 do begin
. }2 q1 F7 y% `+ B6 K        travel to pickaisle.con(A_i)$ N, W9 \: E2 ~/ @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; R, m% J1 V! d3 o        else wait for 10 sec7 Z' o3 s  g/ p* P
        if A_i=A_leave then send to die
/ z6 G& q& ?+ a$ z5 ]* E2 ?% ^: ^        else inc A_i by 1
6 O1 n3 c  H( L( k2 T, z  N    end) G: i9 t6 V4 e
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是个什么东东?
" F& E5 }: B, c: ]& omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; p. {& F# F# T" L# E3 ~, j3 S2 x7 {( ]
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  d- l9 `. r# X3 Z0 _8 c
0 d, v1 f( D( P7 @* U4 ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& B6 l8 S' w' ^) ]! l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- S9 {+ a( L* S0 R) q2 J* P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" j* T" |7 }( W  c; n  H7 d& H3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 t9 K5 ^* S) V1 ~
begin P_induction arriving% d  D; ]0 K4 j6 }+ v' r' W
    clone 1 load to P_pick(A_induct)
! c: |: q  O* z3 Fend最大的系2 F  S$ _, J8 K

$ c7 ^, T  `( K- t0 z1 T5 w* {. N) Fbegin P_pick arriving+ i9 ]; g7 i3 s* t, z
    set A_i to procindex * 10 + 18 @6 ^8 X( H# }* c" a
    move into Q_induct(procindex), Q, N& z. S$ C% ^6 u( z
    move into pickaisle.induct(procindex)& ]0 D( t4 P9 q, i3 a
    /*check the type of pickaisle.induct(i), for your last problem.*/
* V# {& U9 Q' v8 ]3 v8 {( U7 w, {: {7 m6 B
    while A_i<=30 do begin
+ Z# V1 S, y. p, l. B( D        travel to pickaisle.con(A_i)* M2 {. V! f9 S5 d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  k" |( B! B5 X' {# |        else wait for 10 sec" }6 E5 ]. G5 W0 g0 n5 g: [
        if A_i=A_leave then send to die5 c3 x* u* U  W3 A3 {
        else inc A_i by 16 F5 S# M8 ]7 m4 A% U( Y: N
    end: V4 m! @1 M& v* L9 I' M1 U
end) d5 D" y6 [% v" ?4 l

; s: Q4 ]! L, x2 f2 s4 |其中的procindex为整形,代表当前process的序号。
) |) A( u( q4 i3 k1 h% [& l. [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-8-3 18:03 , Processed in 0.017412 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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