设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15308|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! g& ]& W/ k$ L$ p; S" W0 L- Z" R% W0 [' Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( H2 c5 J+ v+ ?) p; D; H7 z+ f/ j
7 M) o- R8 }7 J2 }5 A. d1 O4 h" Bbegin P_read arriving6 ^) k0 ^  [4 S. S; }. e9 K
    while 1=1 do begin
4 y- E+ H: c# `. f% O% t        read A_tote from "data.txt" with delimiter "\n"
! l9 T  N. N8 b- N        read A_time from "data.txt" with delimiter "\n"
+ E! _: b( g5 a- Y" |+ l        read A_leave from "data.txt" with delimiter "\n"
4 v& K! j/ _1 h9 P% O+ U2 G+ ~        read A_picks from "data.txt" with delimiter "\n"% z5 S5 a. o. [$ D3 Y- s
        set load type to A_tote
/ R4 D7 S& _6 i* i8 x        if A_tote="tote 1" then set A_induct to 1$ }( ^  S9 E2 S3 C4 N7 H$ B4 N
        else if A_tote="tote 2" then set A_induct to 2
- J8 r. Y6 k. W! L% Z  X& g            else set A_induct to 3    ! X8 |0 a- _$ T' m
        set A_i to 0: r; p, r+ d3 h3 \6 A4 M/ e
        clone 1 load to P_induction
+ R$ e: l: s8 z/ n  `9 Y        wait for A_time sec
  D! S& g" g/ V) n    end
) I( l$ ?, I; w  ^end. A7 }8 p$ y* l" {5 k9 y3 e3 d

% Q$ m( _& t: T: y+ \! dbegin P_induction arriving
$ L) R6 d6 }, J" j    if A_induct=1 then clone 1 load to P_pick1& _0 x, K7 `, \7 C3 o  m, X
    else if A_induct=2 then clone 1 load to P_pick2
; [" J& l7 D& w  G2 ?. N& E! X$ T6 u        else clone 1 load to P_pick3  Z4 q, K* A: Q1 @7 O1 X" E+ B& _
end8 f9 M, |! b6 ~9 P' C

( p0 d% L( J: R1 `' Rbegin P_pick1 arriving5 n  k' p: S. C( i! K7 O
    set A_i to 1& F) ^; p3 a1 t- c- z
    move into Q_induct1
! \6 n( V9 M5 E0 Z8 c7 u    move into pickaisle.induct1  }* U3 X; u  I( i$ x3 s" r/ g1 K
    while A_i<=30 do begin
1 I, X+ c" @3 K. h- A; X, B        travel to pickaisle.con(A_i)7 s" F/ h( P# F6 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 e0 d$ z" F4 I/ y2 q# r1 x        else wait for 10 sec; i; z" |  M" U* @! s
        if A_i=A_leave then send to die4 F4 m- S$ Q1 _+ X0 p8 c
        else inc A_i by 1+ T; h9 X0 O+ R. u
    end/ h8 z" H- {' ?+ n" \  L( V& b+ |
end
# z1 }. u$ ^4 T) e7 f& a& q0 Z# s( C! \. R# M9 |5 c& {# e
begin P_pick2 arriving# U+ r; q/ B0 A% I$ t% r& t
    set A_i to 119 f. t, P( Q3 @0 I2 p1 h- ^# v! Y& b
    move into Q_induct2
( H* p# [; i7 \- a, k    move into pickaisle.induct25 X0 f/ ]; }+ f. `
    while A_i<=30 do begin9 v9 r0 s$ A3 F/ S; H3 L
        travel to pickaisle.con(A_i)
% d; j5 D" k6 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 R0 B" v' N* `# y+ A        else wait for 10 sec
; \6 K6 v# R" O9 q8 B1 I; W        if A_i=A_leave then send to die
5 Y- O$ f  N& R2 u9 a" Y        else inc A_i by 1- Q" q- q9 S. x" ?7 |
    end4 ]8 f, g* e* i( _: `8 W  g
end
- W4 t$ U3 V+ q3 M3 A. }, Y0 j# Z, \- }- l
begin P_pick3 arriving
. p/ @) t4 w" n9 }) P4 z    set A_i to 21
& d. G0 `# z2 a' R; j  T: s4 h3 Q2 N; u    move into Q_induct3: D5 D5 e: z6 x7 j6 a! L4 i
    move into pickaisle.induct31 `1 J/ m, n! e' _& N. v9 c
    while A_i<=30 do begin
' V/ y- ~! P2 X! ^9 a. v        travel to pickaisle.con(A_i)
0 n6 V$ b0 b7 Z# y6 ]: w9 p  ~4 n* i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 }& C5 C3 b! W0 X; q
        else wait for 10 sec2 b! ?. E5 `; ?6 [/ k
        if A_i=A_leave then send to die
  o  [4 I6 |& ~        else inc A_i by 12 t3 \8 W" g/ {$ }, X
    end
0 G" D9 |: G. g- R  |+ ?( fend

最佳答案

查看完整内容

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是个什么东东?! V+ `9 n4 P1 M0 m4 Q5 x
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! i: ]) n+ c+ I) m3 Z7 U9 s
* L" v( t- g: V' dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. X, `5 W; t7 Z0 ~+ S' v7 K6 S( o3 v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; C- F3 }3 \* x0 K& r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! @) c# n$ N0 z6 u' a5 E8 \8 f2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 }( m% c% q: m3 P  {0 L# M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 Y7 ?4 h' m2 M/ Jbegin P_induction arriving
2 y( |' b( n; K, L8 J    clone 1 load to P_pick(A_induct)7 v) b! B5 ?" |  @1 [. V1 ^" R8 T% _
end最大的系
# n7 |6 Z" a8 R/ }; l; H# |1 S0 F: q" E9 ?1 j1 [* M
begin P_pick arriving
$ c* P9 G3 b- H# y- o. q% {    set A_i to procindex * 10 + 13 {; H) N7 h0 q, V
    move into Q_induct(procindex)( V6 Q1 C9 v- I7 m% ?# N
    move into pickaisle.induct(procindex), L- i" M5 U# v; ]! T2 o
    /*check the type of pickaisle.induct(i), for your last problem.*/
) Z: b# k8 F4 |$ f% `( m* H3 j0 \% x- O% G, [  m( f  q. C
    while A_i<=30 do begin
4 U: e/ `3 P9 m3 A8 `0 v2 s        travel to pickaisle.con(A_i)
" `* `7 |8 n: y6 X  T3 j, P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ W. w+ E! m9 V8 {7 P* J3 v5 X        else wait for 10 sec2 y8 x/ N6 J$ c# U
        if A_i=A_leave then send to die  @, c' ^+ B2 f) t2 k" S* v
        else inc A_i by 1  |3 F9 l" p% c2 j1 v4 v6 o
    end2 S, x" w  e+ V& H" ~, M/ H
end6 Z& ]6 z! p/ R5 x' r8 J  c$ _
; V( {5 I5 j+ T7 p7 m
其中的procindex为整形,代表当前process的序号。2 W, a5 \" I" W: C( P
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-9-1 01:56 , Processed in 0.015978 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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